package nc.tb.analyse.ui;

import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.Line2D;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;

import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JColorChooser;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.ListCellRenderer;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import javax.swing.border.EtchedBorder;
import javax.swing.border.TitledBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.plaf.basic.BasicArrowButton;

import nc.ui.pub.beans.UIButton;
import nc.ui.pub.beans.UICheckBox;
import nc.ui.pub.beans.UIComboBox;
import nc.ui.pub.beans.UILabel;
import nc.ui.pub.beans.UIList;
import nc.ui.pub.beans.UIManager;
import nc.ui.pub.beans.UIPanel;
import nc.ui.pub.beans.UIRadioButton;
import nc.ui.pub.beans.UITabbedPane;
import nc.ui.pub.beans.UITextField;

import com.ufsoft.report.IufoFormat;
import com.ufsoft.report.constant.DefaultSetting;
import com.ufsoft.report.constant.PropertyType;
import com.ufsoft.report.dialog.ColorButton;
import com.ufsoft.report.util.IUFOLogger;
import com.ufsoft.report.util.MultiLang;
import com.ufsoft.table.format.DefaultFormatValue;
import com.ufsoft.table.format.LineFactory;

public class AnaCellFormatSetPnl extends UIPanel implements ActionListener,
		MouseListener {
	class FillCellIcon implements Icon {

		public void paintIcon(Component c, Graphics g, int x, int y) {
			Graphics2D ng = (Graphics2D) g;
			ng.setColor(Color.gray);
			ng.setColor(Color.black);
			int hNum;
			int wNum;
			int yNum;
			int offset;
			if (isCom) {
				hNum = 2;
				wNum = 10;
				yNum = 1;
				offset = 3;
			} else {
				hNum = 10;
				wNum = 30;
				yNum = 4;
				offset = 0;
				Font labelFont = null;
				ng.drawString("", -40, -40);
				labelFont = new Font(m_strFontName, m_nFontStyle, m_nFontSize);
				ng.setFont(labelFont);
				String strText = MultiLang.getString("uiuforep0000734");
				FontMetrics fm = g.getFontMetrics();
				int nSw = fm.stringWidth(strText);
				int nAscent = fm.getAscent();
				int nDescent = fm.getDescent();
				int nLeading = fm.getLeading();
				int nSh = nAscent + nDescent + nLeading;
				ng.setColor(m_nForColor);
				int xoff = (380 - nSw) / 2;
				int yoff = ((h - nSh) / 2 + m_nFontSize) - nDescent;
				ng.drawString(strText, xoff, yoff);
			}
			ng.setColor(Color.black);
			label0: switch (filltype) {
			case 6: // '\006'
			default:
				break;

			case 0: // '\0'
			{
				BasicStroke bs = new BasicStroke();
				ng.setStroke(bs);
				for (int i = 0; i <= hNum; i++) {
					Line2D line = new java.awt.geom.Line2D.Float(x + 1, y
							+ (h / hNum) * i + 4, w, y + (h / hNum) * i + 4);
					ng.draw(line);
				}

				break;
			}

			case 1: // '\001'
			{
				BasicStroke bs = new BasicStroke();
				ng.setStroke(bs);
				for (int i = 1; i <= wNum; i++) {
					Line2D line = new java.awt.geom.Line2D.Float(x + (w / wNum)
							* i, y + 1, x + (w / wNum) * i, h);
					ng.draw(line);
				}

				break;
			}

			case 2: // '\002'
			{
				BasicStroke bs = new BasicStroke();
				ng.setStroke(bs);
				for (int i = 0; i <= hNum; i++) {
					Line2D line = new java.awt.geom.Line2D.Float(x + 1, y
							+ (h / hNum) * i + 4, w, y + (h / hNum) * i + 4);
					ng.draw(line);
				}

				for (int i = 1; i <= wNum; i++) {
					Line2D line = new java.awt.geom.Line2D.Float(x + (w / wNum)
							* i, y + 1, x + (w / wNum) * i, h);
					ng.draw(line);
				}

				break;
			}

			case 3: // '\003'
			{
				BasicStroke bs = new BasicStroke();
				ng.setStroke(bs);
				int m = 0;
				do {
					if (m >= yNum)
						break label0;
					for (int i = 1; i <= wNum; i++) {
						Line2D line = new java.awt.geom.Line2D.Float(x
								+ (w / wNum) * i + offset, y + (h / yNum) * m
								+ 1, x + (w / wNum) * (i - 1), y + (h / yNum)
								* (m + 1) + 1);
						ng.draw(line);
					}

					m++;
				} while (true);
			}

			case 4: // '\004'
			{
				BasicStroke bs = new BasicStroke();
				ng.setStroke(bs);
				int m = 0;
				do {
					if (m >= yNum)
						break label0;
					for (int i = 1; i <= wNum; i++) {
						Line2D line = new java.awt.geom.Line2D.Float(x
								+ (w / wNum) * (i - 1), y + (h / yNum) * m + 1,
								x + (w / wNum) * i + offset, y + (h / yNum)
										* (m + 1) + 1);
						ng.draw(line);
					}

					m++;
				} while (true);
			}

			case 5: // '\005'
			{
				BasicStroke bs = new BasicStroke();
				ng.setStroke(bs);
				int m = 0;
				do {
					if (m >= yNum)
						break label0;
					for (int i = 1; i <= wNum; i++) {
						Line2D line = new java.awt.geom.Line2D.Float(x
								+ (w / wNum) * (i - 1), y + (h / yNum) * m + 1,
								x + (w / wNum) * i + offset, y + (h / yNum)
										* (m + 1) + 1);
						ng.draw(line);
					}

					for (int i = 1; i <= wNum; i++) {
						Line2D line = new java.awt.geom.Line2D.Float(x
								+ (w / wNum) * i + offset, y + (h / yNum) * m
								+ 1, x + (w / wNum) * (i - 1), y + (h / yNum)
								* (m + 1) + 1);
						ng.draw(line);
					}

					m++;
				} while (true);
			}
			}
		}

		public void setFillType(int filltype) {
			this.filltype = filltype;
		}

		public int getIconWidth() {
			return w;
		}

		public int getIconHeight() {
			return h;
		}

		private int filltype;
		private int w;
		private int h;
		private boolean isCom;

		public FillCellIcon() {
			this(true, 0, 125, 15);
		}

		private FillCellIcon(boolean isCom, int filltype, int w, int h) {
			super();
			this.isCom = isCom;
			this.filltype = filltype;
			this.w = w;
			this.h = h;
		}

	}

	class FillCellRenderer extends UILabel implements ListCellRenderer {

		public Component getListCellRendererComponent(JList list, Object value,
				int index, boolean isSelected, boolean cellHasFocus) {
			Object array = value;
			icon.setFillType(Integer.parseInt((String) array));
			setIcon(icon);
			if (isSelected)
				setBorder(redBorder);
			else
				setBorder(emptyBorder);
			return this;
		}

		private static final long serialVersionUID = 7152459686613982428L;
		private FillCellIcon icon;
		private Border redBorder;
		private Border emptyBorder;

		FillCellRenderer() {
			super();
			icon = new FillCellIcon();
			redBorder = BorderFactory.createLineBorder(Color.red, 2);
			emptyBorder = BorderFactory.createEmptyBorder(2, 2, 2, 2);
		}
	}

	class MinusRender extends UILabel implements ListCellRenderer {

		public Component getListCellRendererComponent(JList list, Object value,
				int index, boolean isSelected, boolean cellHasFocus) {
			if (index == -1)
				setOpaque(false);
			else
				setOpaque(true);
			int selValue = ((Integer) value).intValue();
			if (selValue == 2)
				setText("123.45");
			else if (selValue == 0 || selValue == 3)
				setText("-123.45");
			else if (selValue == 1 || selValue == 4)
				setText("(123.45)");
			if (selValue == 0 || selValue == 1)
				setForeground(UIManager.getColor("ComboBox.foreground"));
			else
				setForeground(Color.red);
			if (isSelected)
				setBackground(UIManager
						.getColor("ComboBox.selectionBackground"));
			else
				setBackground(UIManager.getColor("ComboBox.background"));
			return this;
		}

		private static final long serialVersionUID = -810175336955178158L;

		MinusRender() {
			super();
		}
	}

	class LineLabel extends UILabel {

		public void paintComponent(Graphics g) {
			super.paintComponent(g);
			FontMetrics fm = g.getFontMetrics();
			Dimension size = getSize();
			Point point = new Point();
			int sw = fm.stringWidth(getText());
			int ascent = fm.getAscent();
			int descent = fm.getDescent();
			int leading = fm.getLeading();
			point.x = size.width / 2 - sw / 2;
			point.y = size.height / 2 + (ascent + descent + leading) / 2;
			int nIndex = getFontTypeComb().getSelectedIndex();
			if (nIndex == 3 || nIndex == 5 || nIndex == 6 || nIndex == 7) {
				Graphics2D g2 = (Graphics2D) g;
				int nFontSize = getFont().getSize();
				float f = nFontSize / 10;
				BasicStroke sLine = new BasicStroke(f);
				g2.setStroke(sLine);
				g2.setColor(getForeground());
				g2.drawLine(point.x, point.y, point.x + sw, point.y);
			}
		}

		private static final long serialVersionUID = -490697581309498877L;

		LineLabel() {
			super();
		}
	}

	class LineIcon implements Icon {

		public void paintIcon(Component c, Graphics g, int x, int y) {
			Graphics2D ng = (Graphics2D) g;
			ng.setColor(Color.black);
			switch (linetype) {
			case 0: // '\0'
				ng.drawString(MultiLang.getString("uiuforep0000733"),
						x + w / 3, y + 10);
				break;

			case 1: // '\001'
			case 2: // '\002'
			case 3: // '\003'
			case 4: // '\004'
			case 5: // '\005'
			case 6: // '\006'
			case 7: // '\007'
				java.awt.Stroke bs = LineFactory.createLineStroke(linetype);
				ng.setStroke(bs);
				Line2D line = new java.awt.geom.Line2D.Float(x + 4,
						(y + h) / 2, w - 2, (y + h) / 2);
				ng.draw(line);
				break;
			}
		}

		public void setLineType(int linetype) {
			this.linetype = linetype;
		}

		public int getIconWidth() {
			return w;
		}

		public int getIconHeight() {
			return h;
		}

		private int linetype;
		private int w;
		private int h;

		public LineIcon() {
			this(0, 120, 15);
		}

		private LineIcon(int linetype, int w, int h) {
			super();
			this.linetype = linetype;
			this.w = w;
			this.h = h;
		}
	}

	class LineRender extends UILabel implements ListCellRenderer {

		public Component getListCellRendererComponent(JList list, Object value,
				int index, boolean isSelected, boolean cellHasFocus) {
			setText(" ");
			Object array = value;
			icon.setLineType(Integer.parseInt((String) array));
			setIcon(icon);
			if (isSelected)
				setBorder(redBorder);
			else
				setBorder(emptyBorder);
			return this;
		}

		private static final long serialVersionUID = -8749954928568637770L;
		private LineIcon icon;
		private Border redBorder;
		private Border emptyBorder;

		LineRender() {
			super();
			icon = new LineIcon();
			redBorder = BorderFactory.createLineBorder(Color.black, 2);
			emptyBorder = BorderFactory.createEmptyBorder(2, 2, 2, 2);
		}
	}

	private class BorderPanel extends UIPanel {

		public int[] getBorderValue(int nIndex) {
			return border[nIndex];
		}

		public void paintComponent(Graphics g) {
			super.paintComponent(g);
			Graphics2D ng = (Graphics2D) g;
			int width = getWidth();
			int height = getHeight();
			setLineType(ng, 1);
			ng.setColor(Color.lightGray);
			ng.drawLine(width / 8 - 10, height / 8, width / 8, height / 8);
			ng.drawLine(width / 8, height / 8 - 10, width / 8, height / 8);
			ng.drawLine((width / 8) * 7, height / 8, (width / 8) * 7 + 10,
					height / 8);
			ng.drawLine((width / 8) * 7, height / 8 - 10, (width / 8) * 7,
					height / 8);
			ng.drawLine(width / 8 - 10, (height / 8) * 7, width / 8,
					(height / 8) * 7);
			ng.drawLine(width / 8, (height / 8) * 7, width / 8,
					(height / 8) * 7 + 10);
			ng.drawLine((width / 8) * 7, (height / 8) * 7,
					(width / 8) * 7 + 10, (height / 8) * 7);
			ng.drawLine((width / 8) * 7, (height / 8) * 7, (width / 8) * 7,
					(height / 8) * 7 + 10);
			if (!m_bSingleSelected) {
				ng.drawLine(width / 8 - 10, height / 2, width / 8, height / 2);
				ng.drawLine(width / 8, height / 2 - 10, width / 8,
						height / 2 + 10);
				ng.drawLine((width / 8) * 7, height / 2, (width / 8) * 7 + 10,
						height / 2);
				ng.drawLine((width / 8) * 7, height / 2 - 10, (width / 8) * 7,
						height / 2 + 10);
				ng.drawLine(width / 2 - 10, height / 8, width / 2 + 10,
						height / 8);
				ng.drawLine(width / 2, height / 8 - 10, width / 2, height / 8);
				ng.drawLine(width / 2 - 10, (height / 8) * 7, width / 2 + 10,
						(height / 8) * 7);
				ng.drawLine(width / 2, (height / 8) * 7, width / 2,
						(height / 8) * 7 + 10);
			}
			if (border[0][0] != -2) {
				setLineType(ng, border[0][0]);
				Color color = border[0][1] != -2 ? new Color(border[0][1])
						: Color.BLACK;
				ng.setColor(color);
				ng.drawLine(width / 8, height / 8, (width / 8) * 7, height / 8);
			}
			if (border[1][0] != -2) {
				setLineType(ng, border[1][0]);
				Color color = border[1][1] != -2 ? new Color(border[1][1])
						: Color.BLACK;
				ng.setColor(color);
				ng.drawLine(width / 8, (height / 8) * 7, (width / 8) * 7,
						(height / 8) * 7);
			}
			if (border[2][0] != -2) {
				setLineType(ng, border[2][0]);
				Color color = border[2][1] != -2 ? new Color(border[2][1])
						: Color.BLACK;
				ng.setColor(color);
				ng.drawLine(width / 8, height / 8, width / 8, (height / 8) * 7);
			}
			if (border[3][0] != -2) {
				setLineType(ng, border[3][0]);
				Color color = border[3][1] != -2 ? new Color(border[3][1])
						: Color.BLACK;
				ng.setColor(color);
				ng.drawLine((width / 8) * 7, height / 8, (width / 8) * 7,
						(height / 8) * 7);
			}
			if (!m_bSingleSelected) {
				if (border[4][0] != -2) {
					setLineType(ng, border[4][0]);
					Color color = border[4][1] != -2 ? new Color(border[4][1])
							: Color.BLACK;
					ng.setColor(color);
					ng.drawLine(width / 8, height / 2, (width / 8) * 7,
							height / 2);
				}
				if (border[5][0] != -2) {
					setLineType(ng, border[5][0]);
					Color color = border[5][1] != -2 ? new Color(border[5][1])
							: Color.BLACK;
					ng.setColor(color);
					ng.drawLine(width / 2, height / 8, width / 2,
							(height / 8) * 7);
				}
			}
			if (border[6][0] != -2) {
				setLineType(ng, border[6][0]);
				Color color = border[6][1] != -2 ? new Color(border[6][1])
						: Color.BLACK;
				ng.setColor(color);
				ng.drawLine(width / 8, height / 8, (width / 8) * 7,
						(height / 8) * 7);
			}
			if (border[7][0] != -2) {
				setLineType(ng, border[7][0]);
				Color color = border[7][1] != -2 ? new Color(border[7][1])
						: Color.BLACK;
				ng.setColor(color);
				ng.drawLine((width / 8) * 7, height / 8, width / 8,
						(height / 8) * 7);
			}
		}

		public void setBorderValue(int nIndex, int values[]) {
			border[nIndex] = values;
		}

		public void setLineType(Graphics2D ng, int nIndex) {
			switch (nIndex) {
			case 1: // '\001'
			case 2: // '\002'
			case 3: // '\003'
			case 4: // '\004'
			case 5: // '\005'
			case 6: // '\006'
			case 7: // '\007'
				java.awt.Stroke bs = LineFactory.createLineStroke(nIndex);
				ng.setStroke(bs);
				break;
			}
		}

		private static final long serialVersionUID = -1801854031361155398L;
		private int border[][] = { { -2, -2 }, { -2, -2 }, { -2, -2 },
				{ -2, -2 }, { -2, -2 }, { -2, -2 }, { -2, -2 }, { -2, -2 } };

		public BorderPanel() {
			super();
		}
	}

	public AnaCellFormatSetPnl(IufoFormat format, boolean bTypeLocked,
			boolean bSingleSelected) {
		ivjUfoDialogContentPane = null;
		ivjJLabel1 = null;
		ivjJLabel2 = null;
		ivjJLabel3 = null;
		ivjJLabel4 = null;
		ivjJLabel5 = null;
		ivjcancelButton = null;
		ivjCellTabbedPane = null;
		ivjJLabelBackground = null;
		ivjJLabel6 = null;
		ivjJLabel7 = null;
		ivjJLabel8 = null;
		ivjJLabel9 = null;
		ivjJLabel12 = null;
		ivjJLabel13 = null;
		ivjJLabel14 = null;
		ivjJLabel15 = null;
		ivjJLabel16 = null;
		ivjJLabel17 = null;
		ivjAligPanel = null;
		ivjBackColorButton = null;
		ivjBorderPagePanel = null;
		ivjChangeLineCheck = null;
		ivjShrinkFitCheck = null;
		ivjChineseComb = null;
		ivjColorPanel = null;
		ivjCommaCheck = null;
		ivjCurCombo = null;
		ivjDecimalText = null;
		ivjFontNameComb = null;
		ivjFontPagePanel = null;
		ivjFontPanel = null;
		ivjFontSizeComb = null;
		ivjFontTypeComb = null;
		ivjForeColorButton = null;
		ivjHAutoRadio = null;
		ivjHCenterRadio = null;
		ivjHLeftRadio = null;
		ivjHRightRadio = null;
		ivjInnerLineButton = null;
		ivjLineColorButton = null;
		ivjLineStylePanel = null;
		ivjMinusComb = null;
		ivjNoLineButton = null;
		ivjOuterLineButton = null;
		ivjPercentCheck = null;
		ivjPreviewLabel = null;
		ivjPreviewPanel = null;
		ivjSamplePanel = null;
		ivjStylePanel = null;
		ivjTypeList = null;
		ivjTypePagePanel = null;
		ivjTypePanel = null;
		ivjVAutoRadio = null;
		ivjVCenterRadio = null;
		ivjVDownRadio = null;
		ivjVTopRadio = null;
		ivjStringLenLable = null;
		ivjStringLenText = null;
		ivjDateTypeComb = null;
		m_propertyCache = new Hashtable();
		ivjOkButton = null;
		sampleLabel = null;
		ivjAligPagePanel = null;
		ivjBorderPanel = null;
		ivjJLineList = null;
		upAB = new BasicArrowButton(1);
		downAB = new BasicArrowButton(5);
		m_borderPanel = null;
		m_nXLeft = 0;
		m_nXRight = 0;
		m_nYTop = 0;
		m_nYBottom = 0;
		m_nXMid = 0;
		m_nYMid = 0;
		m_LineisNull = false;
		m_isNeedResetBorder = false;
		m_updatedBorder = new boolean[8];
		m_format = null;
		m_bSingleSelected = false;
		btnDiagonal = null;
		btnDiagonal2 = null;
		m_format = format;
		m_bTypeLocked = bTypeLocked;
		m_bSingleSelected = bSingleSelected;
		initialize();
	}

	public AnaCellFormatSetPnl(IufoFormat format, boolean bTypeLocked) {
		this(format, bTypeLocked, true);
	}

	public AnaCellFormatSetPnl(IufoFormat format, boolean bTypeLocked,
			boolean bSingleSelected, boolean bCondition) {
		ivjUfoDialogContentPane = null;
		ivjJLabel1 = null;
		ivjJLabel2 = null;
		ivjJLabel3 = null;
		ivjJLabel4 = null;
		ivjJLabel5 = null;
		ivjcancelButton = null;
		ivjCellTabbedPane = null;
		ivjJLabelBackground = null;
		ivjJLabel6 = null;
		ivjJLabel7 = null;
		ivjJLabel8 = null;
		ivjJLabel9 = null;
		ivjJLabel12 = null;
		ivjJLabel13 = null;
		ivjJLabel14 = null;
		ivjJLabel15 = null;
		ivjJLabel16 = null;
		ivjJLabel17 = null;
		ivjAligPanel = null;
		ivjBackColorButton = null;
		ivjBorderPagePanel = null;
		ivjChangeLineCheck = null;
		ivjShrinkFitCheck = null;
		ivjChineseComb = null;
		ivjColorPanel = null;
		ivjCommaCheck = null;
		ivjCurCombo = null;
		ivjDecimalText = null;
		ivjFontNameComb = null;
		ivjFontPagePanel = null;
		ivjFontPanel = null;
		ivjFontSizeComb = null;
		ivjFontTypeComb = null;
		ivjForeColorButton = null;
		ivjHAutoRadio = null;
		ivjHCenterRadio = null;
		ivjHLeftRadio = null;
		ivjHRightRadio = null;
		ivjInnerLineButton = null;
		ivjLineColorButton = null;
		ivjLineStylePanel = null;
		ivjMinusComb = null;
		ivjNoLineButton = null;
		ivjOuterLineButton = null;
		ivjPercentCheck = null;
		ivjPreviewLabel = null;
		ivjPreviewPanel = null;
		ivjSamplePanel = null;
		ivjStylePanel = null;
		ivjTypeList = null;
		ivjTypePagePanel = null;
		ivjTypePanel = null;
		ivjVAutoRadio = null;
		ivjVCenterRadio = null;
		ivjVDownRadio = null;
		ivjVTopRadio = null;
		ivjStringLenLable = null;
		ivjStringLenText = null;
		ivjDateTypeComb = null;
		m_propertyCache = new Hashtable();
		ivjOkButton = null;
		sampleLabel = null;
		ivjAligPagePanel = null;
		ivjBorderPanel = null;
		ivjJLineList = null;
		upAB = new BasicArrowButton(1);
		downAB = new BasicArrowButton(5);
		m_borderPanel = null;
		m_nXLeft = 0;
		m_nXRight = 0;
		m_nYTop = 0;
		m_nYBottom = 0;
		m_nXMid = 0;
		m_nYMid = 0;
		m_LineisNull = false;
		m_isNeedResetBorder = false;
		m_updatedBorder = new boolean[8];
		m_format = null;
		m_bSingleSelected = false;
		btnDiagonal = null;
		btnDiagonal2 = null;
		m_format = format;
		m_bTypeLocked = bTypeLocked;
		m_bSingleSelected = bSingleSelected;
		m_bCondition = bCondition;
		initialize();
	}
	
	private void setFrameLine(){
		if (!m_LineisNull && m_isNeedResetBorder) {
			int borderIndex = 0;
			int values[] = m_borderPanel.getBorderValue(borderIndex++);
			if (values[1] != 10264988 && m_updatedBorder[0]) {
				setPropertyLater(28, values[0]);
				setPropertyLater(27, values[1]);
			}
			values = m_borderPanel.getBorderValue(borderIndex++);
			if (values[1] != 10264988 && m_updatedBorder[1]) {
				setPropertyLater(4, values[0]);
				setPropertyLater(3, values[1]);
			}
			values = m_borderPanel.getBorderValue(borderIndex++);
			if (values[1] != 10264988 && m_updatedBorder[2]) {
				setPropertyLater(26, values[0]);
				setPropertyLater(25, values[1]);
			}
			values = m_borderPanel.getBorderValue(borderIndex++);
			if (values[1] != 10264988 && m_updatedBorder[3]) {
				setPropertyLater(22, values[0]);
				setPropertyLater(21, values[1]);
			}
			values = m_borderPanel.getBorderValue(borderIndex++);
			if (values[1] != 10264988 && m_updatedBorder[4]) {
				setPropertyLater(31, values[0]);
				setPropertyLater(30, values[1]);
			}
			values = m_borderPanel.getBorderValue(borderIndex++);
			if (values[1] != 10264988 && m_updatedBorder[5]) {
				setPropertyLater(33, values[0]);
				setPropertyLater(32, values[1]);
			}
			values = m_borderPanel.getBorderValue(borderIndex++);
			if (values[1] != 10264988 && m_updatedBorder[6]) {
				setPropertyLater(42, values[0]);
				setPropertyLater(41, values[1]);
			}
			values = m_borderPanel.getBorderValue(borderIndex++);
			if (values[1] != 10264988 && m_updatedBorder[7]) {
				setPropertyLater(44, values[0]);
				setPropertyLater(43, values[1]);
			}
		}
	}

	public void actionPerformed(ActionEvent event) {
		if (event.getSource() instanceof JButton) {
			JButton source = (JButton) event.getSource();
			if (source == ivjOkButton) {
				setFrameLine();
				// setResult(1);
//				if (!m_LineisNull && m_isNeedResetBorder) {
//					int borderIndex = 0;
//					int values[] = m_borderPanel.getBorderValue(borderIndex++);
//					if (values[1] != 10264988 && m_updatedBorder[0]) {
//						setPropertyLater(28, values[0]);
//						setPropertyLater(27, values[1]);
//					}
//					values = m_borderPanel.getBorderValue(borderIndex++);
//					if (values[1] != 10264988 && m_updatedBorder[1]) {
//						setPropertyLater(4, values[0]);
//						setPropertyLater(3, values[1]);
//					}
//					values = m_borderPanel.getBorderValue(borderIndex++);
//					if (values[1] != 10264988 && m_updatedBorder[2]) {
//						setPropertyLater(26, values[0]);
//						setPropertyLater(25, values[1]);
//					}
//					values = m_borderPanel.getBorderValue(borderIndex++);
//					if (values[1] != 10264988 && m_updatedBorder[3]) {
//						setPropertyLater(22, values[0]);
//						setPropertyLater(21, values[1]);
//					}
//					values = m_borderPanel.getBorderValue(borderIndex++);
//					if (values[1] != 10264988 && m_updatedBorder[4]) {
//						setPropertyLater(31, values[0]);
//						setPropertyLater(30, values[1]);
//					}
//					values = m_borderPanel.getBorderValue(borderIndex++);
//					if (values[1] != 10264988 && m_updatedBorder[5]) {
//						setPropertyLater(33, values[0]);
//						setPropertyLater(32, values[1]);
//					}
//					values = m_borderPanel.getBorderValue(borderIndex++);
//					if (values[1] != 10264988 && m_updatedBorder[6]) {
//						setPropertyLater(42, values[0]);
//						setPropertyLater(41, values[1]);
//					}
//					values = m_borderPanel.getBorderValue(borderIndex++);
//					if (values[1] != 10264988 && m_updatedBorder[7]) {
//						setPropertyLater(44, values[0]);
//						setPropertyLater(43, values[1]);
//					}
//				}
				// close();
				return;
			}
			if (source == ivjcancelButton) {
				// setResult(2);
				// close();
				return;
			}
			if (source == ivjInnerLineButton) {
				int values[] = getBorderSet();
				m_borderPanel.setBorderValue(4, values);
				m_borderPanel.setBorderValue(5, values);
				repaint();
				m_isNeedResetBorder = true;
				m_updatedBorder[4] = true;
				m_updatedBorder[5] = true;
				
				setFrameLine();
				return;
			}
			if (source == btnDiagonal) {
				int values[] = getBorderSet();
				m_borderPanel.setBorderValue(6, values);
				repaint();
				m_isNeedResetBorder = true;
				m_updatedBorder[6] = true;
				
				setFrameLine();
				return;
			}
			if (source == btnDiagonal2) {
				int values[] = getBorderSet();
				m_borderPanel.setBorderValue(7, values);
				repaint();
				m_isNeedResetBorder = true;
				m_updatedBorder[7] = true;
				
				setFrameLine();
				return;
			}
			if (source == ivjOuterLineButton) {
				int values[] = getBorderSet();
				m_borderPanel.setBorderValue(0, values);
				m_borderPanel.setBorderValue(1, values);
				m_borderPanel.setBorderValue(2, values);
				m_borderPanel.setBorderValue(3, values);
				repaint();
				m_isNeedResetBorder = true;
				m_updatedBorder[0] = true;
				m_updatedBorder[1] = true;
				m_updatedBorder[2] = true;
				m_updatedBorder[3] = true;
				
				setFrameLine();
				return;
			}
			if (source == ivjNoLineButton) {
				int values[] = { -2, -2 };
				for (int i = 0; i < 8; i++) {
					m_borderPanel.setBorderValue(i, values);
					m_updatedBorder[i] = true;
				}

				if (m_bSingleSelected) {
					m_updatedBorder[4] = false;
					m_updatedBorder[5] = false;
				}
				repaint();
				m_isNeedResetBorder = true;
				
				setFrameLine();
				return;
			}
		} else if (event.getSource() instanceof JRadioButton) {
			JRadioButton source = (JRadioButton) event.getSource();
			if (source == ivjHAutoRadio) {
				ivjJLabel12.setForeground(Color.BLACK);
				setPropertyLater(18, -2);
			} else if (source == ivjHLeftRadio) {
				ivjJLabel12.setForeground(Color.BLACK);
				setPropertyLater(18, 2);
			} else if (source == ivjHCenterRadio) {
				ivjJLabel12.setForeground(Color.BLACK);
				setPropertyLater(18, 0);
			} else if (source == ivjHRightRadio) {
				ivjJLabel12.setForeground(Color.BLACK);
				setPropertyLater(18, 4);
			} else if (source == ivjVAutoRadio) {
				ivjJLabel13.setForeground(Color.BLACK);
				setPropertyLater(24, -2);
			} else if (source == ivjVTopRadio) {
				ivjJLabel13.setForeground(Color.BLACK);
				setPropertyLater(24, 1);
			} else if (source == ivjVCenterRadio) {
				ivjJLabel13.setForeground(Color.BLACK);
				setPropertyLater(24, 0);
			} else if (source == ivjVDownRadio) {
				ivjJLabel13.setForeground(Color.BLACK);
				setPropertyLater(24, 3);
			}
			return;
		}
		repaint();
	}

	private JPanel getAlignPage() {
		if (ivjAligPagePanel == null)
			try {
				ivjAligPagePanel = new UIPanel();
				ivjAligPagePanel.setName("AligPagePanel");
				ivjAligPagePanel.setLayout(null);
				getAlignPage().add(getAlignPageAlignPanel(),
						getAlignPageAlignPanel().getName());
				getAlignPage().add(getAlignPageChangeLineCheck(),
						getAlignPageChangeLineCheck().getName());
				getAlignPage().add(getAlignPageShrinkFitCheck(),
						getAlignPageShrinkFitCheck().getName());
				getAlignPage().add(getAlignPageJLabel14(),
						getAlignPageJLabel14().getName());
				getAlignPage().add(getAlignPageJLabel15(),
						getAlignPageJLabel15().getName());
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjAligPagePanel;
	}

	private JPanel getAlignPageAlignPanel() {
		if (ivjAligPanel == null)
			try {
				ivjAligPanel = new UIPanel();
				ivjAligPanel.setName("AligPanel");
				ivjAligPanel.setLayout(null);
				ivjAligPanel.setBounds(3, 14, 404, 102);
				getAlignPageAlignPanel().add(getJLabel12(),
						getJLabel12().getName());
				getAlignPageAlignPanel().add(getHAutoRadio(),
						getHAutoRadio().getName());
				getAlignPageAlignPanel().add(getHLeftRadio(),
						getHLeftRadio().getName());
				getAlignPageAlignPanel().add(getHCenterRadio(),
						getHCenterRadio().getName());
				getAlignPageAlignPanel().add(getHRightRadio(),
						getHRightRadio().getName());
				getAlignPageAlignPanel().add(getJLabel13(),
						getJLabel13().getName());
				getAlignPageAlignPanel().add(getVAutoRadio(),
						getVAutoRadio().getName());
				getAlignPageAlignPanel().add(getVTopRadio(),
						getVTopRadio().getName());
				getAlignPageAlignPanel().add(getVCenterRadio(),
						getVCenterRadio().getName());
				getAlignPageAlignPanel().add(getVDownRadio(),
						getVDownRadio().getName());
				ivjAligPanel.setBorder(new TitledBorder(new EtchedBorder(),
						MultiLang.getString("uiuforep0000737"), 1, 2, new Font(
								"dialog", 0, 14)));
				ButtonGroup groupH = new ButtonGroup();
				groupH.add(getHAutoRadio());
				groupH.add(getHLeftRadio());
				groupH.add(getHCenterRadio());
				groupH.add(getHRightRadio());
				ButtonGroup groupV = new ButtonGroup();
				groupV.add(getVAutoRadio());
				groupV.add(getVTopRadio());
				groupV.add(getVCenterRadio());
				groupV.add(getVDownRadio());
				int n = getProperty(18);
				if (n == -2)
					n = -2;
				else if (n == -3) {
					n = -2;
					ivjJLabel12.setForeground(Color.gray);
				}
				switch (n) {
				case -2:
					getHAutoRadio().setSelected(true);
					break;

				case 2: // '\002'
					getHLeftRadio().setSelected(true);
					break;

				case 0: // '\0'
					getHCenterRadio().setSelected(true);
					break;

				case 4: // '\004'
					getHRightRadio().setSelected(true);
					break;
				}
				n = getProperty(24);
				if (n == -2)
					n = -2;
				else if (n == -3) {
					n = -2;
					ivjJLabel13.setForeground(Color.gray);
				}
				switch (n) {
				case -2:
					getVAutoRadio().setSelected(true);
					break;

				case 1: // '\001'
					getVTopRadio().setSelected(true);
					break;

				case 0: // '\0'
					getVCenterRadio().setSelected(true);
					break;

				case 3: // '\003'
					getVDownRadio().setSelected(true);
					break;
				}
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjAligPanel;
	}

	private ColorButton getBackColorButton() {
		if (ivjBackColorButton == null)
			try {
				int n = getProperty(2);
				if (n == -2)
					n = DefaultFormatValue.BACK_COLOR.getRGB();
				else if (n == -3) {
					n = Color.gray.getRGB();
					ivjJLabelBackground.setForeground(Color.gray);
				}
				ivjBackColorButton = new ColorButton(new Color(n), this) {

					public void actionPerformed(ActionEvent e) {
						Color c = JColorChooser.showDialog(
								AnaCellFormatSetPnl.this, MultiLang
										.getString("uiuforep0000908"),
								getUserColor());
						if (c != null) {
							ivjJLabelBackground.setForeground(Color.BLACK);
							setUserColor(c);
							setPropertyLater(2, c.getRGB());
							showSample();
						}
					}

					private static final long serialVersionUID = 6779194138869520632L;
				};
				ivjBackColorButton.setName("BackColorButton");
				ivjBackColorButton.setBounds(65, 62, 130, 22);
			} catch (Throwable ivjExc) {
				IUFOLogger.getLogger(this).fatal(
						MultiLang.getString("uiuforep0000909"));
				handleException(ivjExc);
			}
		return ivjBackColorButton;
	}

	private JPanel getBorderPage() {
		if (ivjBorderPagePanel == null)
			try {
				ivjBorderPagePanel = new UIPanel();
				ivjBorderPagePanel.setName("BorderPagePanel");
				ivjBorderPagePanel.setLayout(null);
				getBorderPage().add(getBorderPageBorderPanel(),
						getBorderPageBorderPanel().getName());
				getBorderPage().add(getBorderPageLineStylePanel(),
						getBorderPageLineStylePanel().getName());
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjBorderPagePanel;
	}

	private JPanel getBorderPageBorderPanel() {
		if (ivjBorderPanel == null)
			try {
				ivjBorderPanel = new UIPanel();
				ivjBorderPanel.setName("BorderPanel");
				ivjBorderPanel.setLayout(null);
				ivjBorderPanel.setBounds(1, 11, 245, 255);
				getBorderPageBorderPanel().add(getNoLineButton(),
						getNoLineButton().getName());
				getBorderPageBorderPanel().add(getOuterLineButton(),
						getOuterLineButton().getName());
				getBorderPageBorderPanel().add(getInnerLineButton(),
						getInnerLineButton().getName());
				ivjBorderPanel.setBorder(new TitledBorder(new EtchedBorder(),
						MultiLang.getString("uiuforep0000738"), 1, 2, null));
				m_borderPanel = new BorderPanel();
				m_borderPanel.setName("JPanel1");
				m_borderPanel.setLayout(null);
				m_borderPanel.setBackground(Color.white);
				m_borderPanel.setBounds(16, 22, 214, 133);
				int width = m_borderPanel.getWidth();
				int height = m_borderPanel.getHeight();
				m_nXLeft = width / 8;
				m_nXRight = (width / 8) * 7;
				m_nYTop = height / 8;
				m_nYBottom = (height / 8) * 7;
				m_nXMid = width / 2;
				m_nYMid = height / 2;
				getBorderPageBorderPanel().add(m_borderPanel,
						m_borderPanel.getName());
				ivjBorderPanel.add(getBtnDiagonal(), null);
				ivjBorderPanel.add(getBtnDiagonal2(), null);
				m_borderPanel.addMouseListener(this);
				for (int i = 0; i < m_updatedBorder.length; i++)
					m_updatedBorder[i] = false;

			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjBorderPanel;
	}

	private int[] getBorderSet() {
		int values[] = new int[2];
		if (ivjJLineList.getSelectedIndex() != -1)
			values[0] = ivjJLineList.getSelectedIndex();
		else
			values[0] = -2;
		values[1] = ivjLineColorButton.getUserColor().getRGB();
		return values;
	}

	private JButton getcancelButton() {
		if (ivjcancelButton == null)
			try {
				ivjcancelButton = new UIButton();
				ivjcancelButton.setName("cancelButton");
				ivjcancelButton.setText(MultiLang.getString("uiuforep0000739"));
				ivjcancelButton.setBounds(339, 314, 75, 22);
				ivjcancelButton.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjcancelButton;
	}

	public UITabbedPane getTabbedPane() {
		if (ivjCellTabbedPane == null)
			try {
				ivjCellTabbedPane = new UITabbedPane();
				ivjCellTabbedPane.setName("CellTabbedPane");
				ivjCellTabbedPane.setBackground(SystemColor.control);
				ivjCellTabbedPane.setBounds(9, 7, 415, 298);
				ivjCellTabbedPane.setBorder(null);
				int tabIndex = 0;
				if (!m_bCondition)
					ivjCellTabbedPane.insertTab(MultiLang
							.getString("uiuforep0000740"), null,
							getDataTypePage(), null, tabIndex++);
				ivjCellTabbedPane.insertTab(MultiLang
						.getString("uiuforep0000741"), null, getFontPage(),
						null, tabIndex++);
//				if (!m_bCondition) {
					ivjCellTabbedPane.insertTab(MultiLang
							.getString("uiuforep0000742"), null,
							getAlignPage(), null, tabIndex++);
					ivjCellTabbedPane.insertTab(MultiLang
							.getString("uiuforep0000743"), null,
							getBorderPage(), null, tabIndex++);
//				}
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjCellTabbedPane;
	}

	private JCheckBox getAlignPageChangeLineCheck() {
		if (ivjChangeLineCheck == null)
			try {
				ivjChangeLineCheck = new UICheckBox();
				ivjChangeLineCheck.setName("ChangeLineCheck");
				ivjChangeLineCheck.setText(MultiLang
						.getString("uiuforep0000744"));
				ivjChangeLineCheck.setBounds(18, 125, 178, 27);
				int n = getProperty(5);
				if (n == -2 || n == 0)
					ivjChangeLineCheck.setSelected(false);
				else if (n == 1) {
					ivjChangeLineCheck.setSelected(true);
					getAlignPageShrinkFitCheck().setEnabled(false);
				} else if (n == -3) {
					ivjChangeLineCheck.setSelected(true);
					ivjChangeLineCheck.setForeground(Color.gray);
				}
				ivjChangeLineCheck.addItemListener(new ItemListener() {

					public void itemStateChanged(ItemEvent e) {
						if (e.getStateChange() == 1) {
							setPropertyLater(5, 1);
							ivjShrinkFitCheck.setEnabled(false);
						} else if (e.getStateChange() == 2) {
							setPropertyLater(5, 0);
							ivjShrinkFitCheck.setEnabled(true);
						}
						ivjChangeLineCheck.setForeground(Color.black);
					}

				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjChangeLineCheck;
	}

	private JComboBox getChineseComb() {
		if (ivjChineseComb == null)
			try {
				ivjChineseComb = new UIComboBox();
				ivjChineseComb.setName("ChineseComb");
				ivjChineseComb.setBounds(90, 114, 178, 27);
				String str[] = DefaultSetting.chineseFormat;
				for (int i = 0; i < str.length; i++)
					ivjChineseComb.addItem(str[i]);

				int n = getProperty(6);
				if (n == -2 || n == 0)
					n = 0;
				else if (n == -3) {
					n = -1;
					ivjJLabel3.setForeground(Color.gray);
				}
				ivjChineseComb.setSelectedIndex(n);
				ivjChineseComb.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent event) {
						if (ivjCommaCheck.getSelectedObjects() != null
								|| ivjPercentCheck.getSelectedObjects() != null) {
							Object options[] = {
									MultiLang.getString("uiuforep0000745"),
									MultiLang.getString("uiuforep0000746") };
							int nReturn = JOptionPane
									.showOptionDialog(
											AnaCellFormatSetPnl.this,
											MultiLang
													.getString("uiuforep0000747"),
											"Warning", -1, 2, null, options,
											options[0]);
							if (nReturn == 0) {
								ivjCommaCheck.setSelected(false);
								ivjPercentCheck.setSelected(false);
							} else {
								int n = getProperty(6);
								if (n == -2 || n == 0)
									n = 0;
								else if (n == -3)
									ivjChineseComb.setForeground(Color.gray);
								ivjChineseComb.setSelectedIndex(n);
								return;
							}
						}
						int n = ivjChineseComb.getSelectedIndex();
						ivjJLabel3.setForeground(Color.BLACK);
						setPropertyLater(6, n);
						showPreview();
					}

				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjChineseComb;
	}

	private JComboBox getDateTypeCombo() {
		if (ivjDateTypeComb == null)
			try {
				ivjDateTypeComb = new UIComboBox();
				ivjDateTypeComb.setName("DateTypeComb");
				ivjDateTypeComb.setBounds(90, 21, 178, 27);
				String str[] = DefaultSetting.dateFormat;
				for (int i = 0; i < str.length; i++)
					ivjDateTypeComb.addItem(str[i]);

				int n = getProperty(34);
				if (n == -2 || n == 0)
					n = 0;
				else if (n == -3) {
					n = -1;
					ivjJLabel5.setForeground(Color.gray);
				}
				ivjDateTypeComb.setSelectedIndex(n);
				ivjDateTypeComb.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent event) {
						int n = ivjDateTypeComb.getSelectedIndex();
						ivjJLabel5.setForeground(Color.BLACK);
						setPropertyLater(34, n);
						showPreview();
					}

				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjDateTypeComb;
	}

	private JPanel getFontPageColorPanel() {
		if (ivjColorPanel == null)
			try {
				ivjColorPanel = new UIPanel();
				ivjColorPanel.setName("ColorPanel");
				ivjColorPanel.setLayout(null);
				ivjColorPanel.setBounds(201, 12, 206, 142);
				getFontPageColorPanel().add(getJLabel9(),
						getJLabel9().getName());
				getFontPageColorPanel().add(getForeColorButton(),
						getForeColorButton().getName());
				getFontPageColorPanel().add(getJLabelBackground(),
						getJLabelBackground().getName());
				getFontPageColorPanel().add(getBackColorButton(),
						getBackColorButton().getName());
				ivjColorPanel.setBorder(new TitledBorder(new EtchedBorder(),
						MultiLang.getString("uiuforep0000748"), 1, 2, new Font(
								"dialog", 0, 14)));
			} catch (Throwable ivjExc) {
				System.out.println((new StringBuilder()).append(
						"error in getColorPanel():")
						.append(ivjExc.getMessage()).toString());
				handleException(ivjExc);
			}
		return ivjColorPanel;
	}

	private JCheckBox getCommaCheck() {
		if (ivjCommaCheck == null)
			try {
				ivjCommaCheck = new UICheckBox();
				ivjCommaCheck.setName("CommaCheck");
				ivjCommaCheck.setText(MultiLang.getString("uiuforep0000749"));
				ivjCommaCheck.setBounds(13, 19, 67, 26);
				int n = getProperty(8);
				if (n == -2 || n == 0)
					ivjCommaCheck.setSelected(false);
				else if (n == 1)
					ivjCommaCheck.setSelected(true);
				else if (n == -3) {
					ivjCommaCheck.setSelected(true);
					ivjCommaCheck.setForeground(Color.gray);
				}
				ivjCommaCheck.addItemListener(new ItemListener() {

					public void itemStateChanged(ItemEvent e) {
						if (ivjChineseComb.getSelectedIndex() != 0
								&& e.getStateChange() == 1) {
							JOptionPane.showMessageDialog(
									AnaCellFormatSetPnl.this, MultiLang
											.getString("uiuforep0000750"),
									MultiLang.getString("uiuforep0000751"), 1);
							ivjCommaCheck.setSelected(false);
							return;
						}
						if (e.getStateChange() == 1) {
							setPropertyLater(8, 1);
							showPreview();
						} else if (e.getStateChange() == 2) {
							setPropertyLater(8, 0);
							showPreview();
						}
						ivjCommaCheck.setForeground(Color.black);
					}

				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjCommaCheck;
	}

	private JComboBox getCurCombo() {
		if (ivjCurCombo == null)
			try {
				ivjCurCombo = new UIComboBox();
				ivjCurCombo.setName("CurCombo");
				ivjCurCombo.setBounds(90, 82, 178, 27);
				String str[] = DefaultSetting.currencySymbol;
				for (int i = 0; i < str.length; i++)
					ivjCurCombo.addItem(str[i]);

				int n = getProperty(9);
				if (n == -2 || n == 0)
					n = 0;
				else if (n == -3) {
					n = -1;
					ivjJLabel2.setForeground(Color.gray);
				}
				ivjCurCombo.setSelectedIndex(n);
				ivjCurCombo.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent event) {
						ivjJLabel2.setForeground(Color.black);
						int nIndex = ivjCurCombo.getSelectedIndex();
						setPropertyLater(9, nIndex);
						showPreview();
					}
				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjCurCombo;
	}

	private JTextField getDecimalText() {
		if (ivjDecimalText == null)
			try {
				ivjDecimalText = new UITextField();
				ivjDecimalText.setName("DecimalText");
				ivjDecimalText.setBounds(90, 49, 156, 28);
				int n = getProperty(11);
				if (n == -2)
					n = 2;
				else if (n == -3) {
					n = 2;
					ivjJLabel4.setForeground(Color.gray);
				}
				ivjDecimalText.setText(String.valueOf(n));
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjDecimalText;
	}

	private JComboBox getFontNameComb() {
		if (ivjFontNameComb == null)
			try {
				ivjFontNameComb = new UIComboBox();
				ivjFontNameComb.setName("FontNameComb");
				ivjFontNameComb.setBounds(52, 27, 130, 27);
				String fontNames[] = DefaultSetting.fontNames;
				if (fontNames != null) {
					int songti = 0;
					for (int i = 0; i < fontNames.length; i++) {
						if (fontNames[i] != null && !fontNames[i].equals(""))
							ivjFontNameComb.addItem(fontNames[i]);
						try {
							if (fontNames[i].equals("\u5B8B\u4F53"))
								songti = i;
						} catch (Exception e) {
							songti = 0;
						}
					}

					int fontIndex = getProperty(13);
					if (fontIndex == -2)
						fontIndex = songti;
					else if (fontIndex == -3) {
						fontIndex = -1;
						ivjJLabel6.setForeground(Color.gray);
					}
					ivjFontNameComb.setSelectedIndex(fontIndex);
				}
				ivjFontNameComb.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent event) {
						ivjJLabel6.setForeground(Color.BLACK);
						int nIndex = ivjFontNameComb.getSelectedIndex();
						setPropertyLater(13, nIndex);
						showSample();
					}
				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjFontNameComb;
	}

	private JPanel getFontPage() {
		if (ivjFontPagePanel == null)
			try {
				ivjFontPagePanel = new UIPanel();
				ivjFontPagePanel.setName("FontPagePanel");
				ivjFontPagePanel.setLayout(null);
				getFontPage().add(getFontPageFontPanel(),
						getFontPageFontPanel().getName());
				getFontPage().add(getFontPageColorPanel(),
						getFontPageColorPanel().getName());
				getFontPage().add(getFontPageSamplePanel(),
						getFontPageSamplePanel().getName());
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjFontPagePanel;
	}

	private JPanel getFontPageFontPanel() {
		if (ivjFontPanel == null)
			try {
				ivjFontPanel = new UIPanel();
				ivjFontPanel.setName("FontPanel");
				ivjFontPanel.setLayout(null);
				ivjFontPanel.setBounds(2, 12, 197, 142);
				getFontPageFontPanel()
						.add(getJLabel6(), getJLabel6().getName());
				getFontPageFontPanel().add(getFontNameComb(),
						getFontNameComb().getName());
				getFontPageFontPanel()
						.add(getJLabel7(), getJLabel7().getName());
				getFontPageFontPanel().add(getFontTypeComb(),
						getFontTypeComb().getName());
				getFontPageFontPanel()
						.add(getJLabel8(), getJLabel8().getName());
				getFontPageFontPanel().add(getFontSizeComb(),
						getFontSizeComb().getName());
				ivjFontPanel.setBorder(new TitledBorder(new EtchedBorder(),
						MultiLang.getString("uiuforep0000754"), 1, 2, new Font(
								"dialog", 0, 14)));
			} catch (Throwable ivjExc) {
				System.out.println((new StringBuilder()).append(
						"error in getFontPanel():").append(ivjExc.getMessage())
						.toString());
				handleException(ivjExc);
			}
		return ivjFontPanel;
	}

	private JComboBox getFontSizeComb() {
		if (ivjFontSizeComb == null)
			try {
				ivjFontSizeComb = new UIComboBox();
				ivjFontSizeComb.setName("FontSizeComb");
				ivjFontSizeComb.setBounds(52, 98, 130, 27);
				for (int i = 0; i < DefaultSetting.fontSizes.length; i++)
					ivjFontSizeComb.addItem(DefaultSetting.fontSizes[i]);

				int n = getProperty(14);
				if (n == -2)
					n = 14;
				else if (n == -3) {
					n = -1;
					ivjJLabel8.setForeground(Color.gray);
				}
				int i = 0;
				do {
					if (i >= DefaultSetting.fontSizes.length)
						break;
					int each = Integer.parseInt(DefaultSetting.fontSizes[i]);
					if (n <= each) {
						n = each;
						break;
					}
					i++;
				} while (true);
				ivjFontSizeComb.setSelectedItem(String.valueOf(n));
				ivjFontSizeComb.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent event) {
						ivjJLabel8.setForeground(Color.BLACK);
						String strSize = (String) ivjFontSizeComb
								.getSelectedItem();
						int nSize = Integer.parseInt(strSize);
						setPropertyLater(14, nSize);
						showSample();
					}

				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjFontSizeComb;
	}

	private JComboBox getFontTypeComb() {
		if (ivjFontTypeComb == null)
			try {
				ivjFontTypeComb = new UIComboBox();
				ivjFontTypeComb.setName("FontTypeComb");
				ivjFontTypeComb.setBounds(52, 62, 130, 27);
				for (int i = 0; i < DefaultSetting.fontStyles.length; i++)
					ivjFontTypeComb.addItem(DefaultSetting.fontStyles[i]);

				int n = getProperty(15);
				if (n == -2)
					n = 0;
				else if (n == -3) {
					n = -1;
					ivjJLabel7.setForeground(Color.gray);
				}
				ivjFontTypeComb.setSelectedIndex(n);
				ivjFontTypeComb.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent event) {
						ivjJLabel7.setForeground(Color.BLACK);
						int nIndex = ivjFontTypeComb.getSelectedIndex();
						setPropertyLater(15, nIndex);
						showSample();
					}
				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjFontTypeComb;
	}

	private ColorButton getForeColorButton() {
		if (ivjForeColorButton == null)
			try {
				int n = getProperty(16);
				if (n == -2)
					n = DefaultFormatValue.FORE_COLOR.getRGB();
				else if (n == -3) {
					n = Color.gray.getRGB();
					ivjJLabel9.setForeground(Color.gray);
				}
				ivjForeColorButton = new ColorButton(new Color(n), this) {

					public void actionPerformed(ActionEvent e) {
						Color c = JColorChooser.showDialog(
								AnaCellFormatSetPnl.this, MultiLang
										.getString("uiuforep0000906"),
								getUserColor());
						if (c != null) {
							ivjJLabel9.setForeground(Color.BLACK);
							setUserColor(c);
							setPropertyLater(16, c.getRGB());
							showSample();
						}
					}

					private static final long serialVersionUID = 2108696882366348284L;
				};
				ivjForeColorButton.setName("ForeColorButton");
				ivjForeColorButton.setBounds(65, 27, 130, 22);
			} catch (Throwable ivjExc) {
				IUFOLogger.getLogger(this).fatal(
						MultiLang.getString("uiuforep0000907"));
				handleException(ivjExc);
			}
		return ivjForeColorButton;
	}

	private JRadioButton getHAutoRadio() {
		if (ivjHAutoRadio == null)
			try {
				ivjHAutoRadio = new UIRadioButton();
				ivjHAutoRadio.setName("HAutoRadio");
				ivjHAutoRadio.setText(MultiLang.getString("uiuforep0000755"));
				ivjHAutoRadio.setBounds(118, 25, 53, 26);
				ivjHAutoRadio.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjHAutoRadio;
	}

	private JRadioButton getHCenterRadio() {
		if (ivjHCenterRadio == null)
			try {
				ivjHCenterRadio = new UIRadioButton();
				ivjHCenterRadio.setName("HCenterRadio");
				ivjHCenterRadio.setText(MultiLang.getString("uiuforep0000756"));
				ivjHCenterRadio.setBounds(260, 25, 53, 26);
				ivjHCenterRadio.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjHCenterRadio;
	}

	private JRadioButton getHLeftRadio() {
		if (ivjHLeftRadio == null)
			try {
				ivjHLeftRadio = new UIRadioButton();
				ivjHLeftRadio.setName("HLeftRadio");
				ivjHLeftRadio.setText(MultiLang.getString("uiuforep0000757"));
				ivjHLeftRadio.setBounds(189, 25, 53, 26);
				ivjHLeftRadio.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjHLeftRadio;
	}

	private JRadioButton getHRightRadio() {
		if (ivjHRightRadio == null)
			try {
				ivjHRightRadio = new UIRadioButton();
				ivjHRightRadio.setName("HRightRadio");
				ivjHRightRadio.setText(MultiLang.getString("uiuforep0000758"));
				ivjHRightRadio.setBounds(331, 25, 53, 26);
				ivjHRightRadio.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjHRightRadio;
	}

	private JButton getInnerLineButton() {
		if (ivjInnerLineButton == null)
			try {
				ivjInnerLineButton = new UIButton();
				ivjInnerLineButton.setName("InnerLineButton");
				ivjInnerLineButton.setText(MultiLang
						.getString("uiuforep0000759"));
				ivjInnerLineButton.setBounds(164, 194, 74, 22);
				ivjInnerLineButton.addActionListener(this);
				if (m_bSingleSelected)
					ivjInnerLineButton.setEnabled(false);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjInnerLineButton;
	}

	private JLabel getJLabel1() {
		if (ivjJLabel1 == null)
			try {
				ivjJLabel1 = new UILabel();
				ivjJLabel1.setName("JLabel1");
				ivjJLabel1.setText(MultiLang.getString("uiuforep0000760"));
				ivjJLabel1.setBackground(SystemColor.control);
				ivjJLabel1.setBounds(13, 150, 56, 18);
				ivjJLabel1.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel1;
	}

	private JLabel getJLabelBackground() {
		if (ivjJLabelBackground == null)
			try {
				ivjJLabelBackground = new UILabel();
				ivjJLabelBackground.setName("JLabel10");
				ivjJLabelBackground.setText(MultiLang
						.getString("uiuforep0000761"));
				ivjJLabelBackground.setBounds(13, 67, 42, 18);
				ivjJLabelBackground.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabelBackground;
	}

	private JLabel getJLabel12() {
		if (ivjJLabel12 == null)
			try {
				ivjJLabel12 = new UILabel();
				ivjJLabel12.setName("JLabel12");
				ivjJLabel12.setText(MultiLang.getString("uiuforep0000763"));
				ivjJLabel12.setBounds(18, 29, 82, 18);
				ivjJLabel12.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel12;
	}

	private JLabel getJLabel13() {
		if (ivjJLabel13 == null)
			try {
				ivjJLabel13 = new UILabel();
				ivjJLabel13.setName("JLabel13");
				ivjJLabel13.setText(MultiLang.getString("uiuforep0000764"));
				ivjJLabel13.setBounds(18, 65, 88, 18);
				ivjJLabel13.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel13;
	}

	private JLabel getAlignPageJLabel14() {
		if (ivjJLabel14 == null)
			try {
				ivjJLabel14 = new UILabel();
				ivjJLabel14.setName("JLabel14");
				ivjJLabel14.setText(MultiLang.getString("uiuforep0000765"));
				ivjJLabel14.setForeground(Color.black);
				ivjJLabel14.setVerticalTextPosition(3);
				ivjJLabel14.setVerticalAlignment(3);
				ivjJLabel14.setBounds(16, 171, 383, 23);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel14;
	}

	private JLabel getAlignPageJLabel15() {
		if (ivjJLabel15 == null)
			try {
				ivjJLabel15 = new UILabel();
				ivjJLabel15.setName("JLabel15");
				ivjJLabel15.setText(MultiLang.getString("uiuforep0000766"));
				ivjJLabel15.setBounds(16, 203, 257, 16);
				ivjJLabel15.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel15;
	}

	private JLabel getJLabel16() {
		if (ivjJLabel16 == null)
			try {
				ivjJLabel16 = new UILabel();
				ivjJLabel16.setName("JLabel16");
				ivjJLabel16.setText(MultiLang.getString("uiuforep0000767"));
				ivjJLabel16.setBounds(17, 22, 52, 16);
				ivjJLabel16.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel16;
	}

	private JLabel getJLabel17() {
		if (ivjJLabel17 == null)
			try {
				ivjJLabel17 = new UILabel();
				ivjJLabel17.setName("JLabel17");
				ivjJLabel17.setText(MultiLang.getString("uiuforep0000768"));
				ivjJLabel17.setBounds(17, 207, 52, 16);
				ivjJLabel17.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel17;
	}

	private JLabel getJLabel2() {
		if (ivjJLabel2 == null)
			try {
				ivjJLabel2 = new UILabel();
				ivjJLabel2.setName("JLabel2");
				ivjJLabel2.setText(MultiLang.getString("uiuforep0000769"));
				ivjJLabel2.setBackground(SystemColor.control);
				ivjJLabel2.setBounds(13, 86, 56, 18);
				ivjJLabel2.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel2;
	}

	private JLabel getJLabel3() {
		if (ivjJLabel3 == null)
			try {
				ivjJLabel3 = new UILabel();
				ivjJLabel3.setName("JLabel3");
				ivjJLabel3.setText(MultiLang.getString("uiuforep0000770"));
				ivjJLabel3.setBackground(SystemColor.control);
				ivjJLabel3.setBounds(13, 118, 70, 18);
				ivjJLabel3.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel3;
	}

	private JLabel getJLabel4() {
		if (ivjJLabel4 == null)
			try {
				ivjJLabel4 = new UILabel();
				ivjJLabel4.setName("JLabel4");
				ivjJLabel4.setText(MultiLang.getString("uiuforep0000771"));
				ivjJLabel4.setBackground(SystemColor.control);
				ivjJLabel4.setBounds(13, 54, 56, 18);
				ivjJLabel4.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel4;
	}

	private JLabel getJLabel5() {
		if (ivjJLabel5 == null)
			try {
				ivjJLabel5 = new UILabel();
				ivjJLabel5.setName("JLabel5");
				ivjJLabel5.setText(MultiLang.getString("miufo00003"));
				ivjJLabel5.setBackground(SystemColor.control);
				ivjJLabel5.setBounds(23, 21, 70, 22);
				ivjJLabel5.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel5;
	}

	private JLabel getJLabel6() {
		if (ivjJLabel6 == null)
			try {
				ivjJLabel6 = new UILabel();
				ivjJLabel6.setName("JLabel6");
				ivjJLabel6.setText(MultiLang.getString("uiuforep0000772"));
				ivjJLabel6.setBounds(15, 34, 28, 18);
				ivjJLabel6.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel6;
	}

	private JLabel getJLabel7() {
		if (ivjJLabel7 == null)
			try {
				ivjJLabel7 = new UILabel();
				ivjJLabel7.setName("JLabel7");
				ivjJLabel7.setText(MultiLang.getString("uiuforep0000773"));
				ivjJLabel7.setBounds(15, 67, 28, 18);
				ivjJLabel7.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel7;
	}

	private JLabel getJLabel8() {
		if (ivjJLabel8 == null)
			try {
				ivjJLabel8 = new UILabel();
				ivjJLabel8.setName("JLabel8");
				ivjJLabel8.setText(MultiLang.getString("uiuforep0000774"));
				ivjJLabel8.setBounds(17, 102, 28, 18);
				ivjJLabel8.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel8;
	}

	private JLabel getJLabel9() {
		if (ivjJLabel9 == null)
			try {
				ivjJLabel9 = new UILabel();
				ivjJLabel9.setName("JLabel9");
				ivjJLabel9.setText(MultiLang.getString("uiuforep0000775"));
				ivjJLabel9.setBounds(13, 34, 42, 18);
				ivjJLabel9.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLabel9;
	}

	private JList getJLineList() {
		if (ivjJLineList == null)
			try {
				ivjJLineList = new UIList();
				ivjJLineList.setName("JLineList");
				ivjJLineList.setBounds(17, 39, 128, 165);
				ivjJLineList.setBorder(new BevelBorder(1));
				String typeName[] = { (new Integer(0)).toString(),
						(new Integer(1)).toString(),
						(new Integer(2)).toString(),
						(new Integer(3)).toString(),
						(new Integer(4)).toString(),
						(new Integer(5)).toString(),
						(new Integer(6)).toString(),
						(new Integer(7)).toString() };
				ivjJLineList.setListData(typeName);
				ivjJLineList.setCellRenderer(new LineRender());
				ivjJLineList.setSelectedIndex(1);
				ivjJLineList
						.addListSelectionListener(new ListSelectionListener() {

							public void valueChanged(ListSelectionEvent e) {
								if (!e.getValueIsAdjusting()) {
									int nIndex = ivjJLineList
											.getSelectedIndex();
									if (nIndex == -1)
										m_LineisNull = true;
									else
										m_LineisNull = false;
								}
							}

						});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjJLineList;
	}

	private ColorButton getLineColorButton() {
		if (ivjLineColorButton == null)
			try {
				ivjLineColorButton = new ColorButton(DefaultSetting.LINE_COLOR,
						this) {

					public void actionPerformed(ActionEvent e) {
						Color c = JColorChooser.showDialog(
								AnaCellFormatSetPnl.this, MultiLang
										.getString("uiuforep0000910"),
								getUserColor());
						if (c != null) {
							ivjJLabel17.setForeground(Color.BLACK);
							setUserColor(c);
						}
					}

					private static final long serialVersionUID = -8424089644512374377L;
				};
				ivjLineColorButton.setName("LineColorButton");
				ivjLineColorButton.setBounds(17, 225, 130, 22);
			} catch (Throwable ivjExc) {
				IUFOLogger.getLogger(this).fatal(
						MultiLang.getString("uiuforep0000911"));
				handleException(ivjExc);
			}
		return ivjLineColorButton;
	}

	private JPanel getBorderPageLineStylePanel() {
		if (ivjLineStylePanel == null)
			try {
				ivjLineStylePanel = new UIPanel();
				ivjLineStylePanel.setName("LineStylePanel");
				ivjLineStylePanel.setLayout(null);
				ivjLineStylePanel.setBounds(247, 11, 160, 255);
				getBorderPageLineStylePanel().add(getJLabel16(),
						getJLabel16().getName());
				getBorderPageLineStylePanel().add(getJLabel17(),
						getJLabel17().getName());
				getBorderPageLineStylePanel().add(getLineColorButton(),
						getLineColorButton().getName());
				getBorderPageLineStylePanel().add(getJLineList(),
						getJLineList().getName());
				ivjLineStylePanel.setBorder(new TitledBorder(
						new EtchedBorder(), MultiLang.getString("line_type"),
						1, 2, new Font("dialog", 0, 14)));
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjLineStylePanel;
	}

	private JComboBox getMinusComb() {
		if (ivjMinusComb == null)
			try {
				ivjMinusComb = new UIComboBox();
				ivjMinusComb.setName("MinusComb");
				ivjMinusComb.setBounds(90, 146, 178, 27);
				ivjMinusComb.setRenderer(new MinusRender());
				ivjMinusComb.addItem(new Integer(0));
				ivjMinusComb.addItem(new Integer(1));
				ivjMinusComb.addItem(new Integer(2));
				ivjMinusComb.addItem(new Integer(3));
				ivjMinusComb.addItem(new Integer(4));
				int n = getProperty(19);
				if (n == -2)
					n = 0;
				else if (n == -3) {
					n = -1;
					ivjJLabel1.setForeground(Color.gray);
				}
				ivjMinusComb.setSelectedIndex(n);
				ivjMinusComb.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent event) {
						int nIndex = ivjMinusComb.getSelectedIndex();
						ivjMinusComb.transferFocus();
						setPropertyLater(19, nIndex);
						showPreview();
					}
				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjMinusComb;
	}

	private JButton getNoLineButton() {
		if (ivjNoLineButton == null)
			try {
				ivjNoLineButton = new UIButton();
				ivjNoLineButton.setName("NoLineButton");
				ivjNoLineButton.setText(MultiLang.getString("uiuforep0000781"));
				ivjNoLineButton.setBounds(12, 194, 75, 22);
				ivjNoLineButton.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjNoLineButton;
	}

	private JButton getOkButton() {
		if (ivjOkButton == null)
			try {
				ivjOkButton = new UIButton();
				ivjOkButton.setName("OkButton");
				ivjOkButton.setText(MultiLang.getString("uiuforep0000782"));
				ivjOkButton.setBounds(239, 315, 75, 22);
				ivjOkButton.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjOkButton;
	}

	private JButton getOuterLineButton() {
		if (ivjOuterLineButton == null)
			try {
				ivjOuterLineButton = new UIButton();
				ivjOuterLineButton.setName("OuterLineButton");
				ivjOuterLineButton.setText(MultiLang.getString("miufo00004"));
				ivjOuterLineButton.setBounds(88, 194, 75, 22);
				ivjOuterLineButton.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjOuterLineButton;
	}

	private JCheckBox getPercentCheck() {
		if (ivjPercentCheck == null)
			try {
				ivjPercentCheck = new UICheckBox();
				ivjPercentCheck.setName("PercentCheck");
				ivjPercentCheck.setText(MultiLang.getString("uiuforep0000784"));
				ivjPercentCheck.setBounds(90, 19, 67, 26);
				int n = getProperty(20);
				if (n == -2 || n == 0)
					ivjPercentCheck.setSelected(false);
				else if (n == 1)
					ivjPercentCheck.setSelected(true);
				else if (n == -3) {
					ivjPercentCheck.setSelected(true);
					ivjPercentCheck.setForeground(Color.gray);
				}
				ivjPercentCheck.addItemListener(new ItemListener() {

					public void itemStateChanged(ItemEvent e) {
						if (ivjChineseComb.getSelectedIndex() != 0
								&& e.getStateChange() == 1) {
							JOptionPane.showMessageDialog(
									AnaCellFormatSetPnl.this, MultiLang
											.getString("uiuforep0000785"),
									MultiLang.getString("uiuforep0000786"), 1);
							ivjPercentCheck.setSelected(false);
							return;
						}
						if (e.getStateChange() == 1) {
							setPropertyLater(20, 1);
							showPreview();
						} else if (e.getStateChange() == 2) {
							setPropertyLater(20, 0);
							showPreview();
						}
						if (ivjCommaCheck.getSelectedObjects() != null)
							ivjCommaCheck.setSelected(true);
						ivjPreviewLabel.repaint();
						ivjPercentCheck.repaint();
						ivjPercentCheck.setForeground(Color.black);
					}
				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjPercentCheck;
	}

	private JLabel getPreviewLabel() {
		if (ivjPreviewLabel == null)
			try {
				ivjPreviewLabel = new UILabel();
				ivjPreviewLabel.setName("PreviewLabel");
				ivjPreviewLabel.setText("12345.67");
				ivjPreviewLabel.setForeground(Color.black);
				ivjPreviewLabel.setBounds(8, 12, 263, 42);
				ivjPreviewLabel.setHorizontalAlignment(0);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjPreviewLabel;
	}

	private JPanel getDataTypePagePreviewPanel() {
		if (ivjPreviewPanel == null)
			try {
				ivjPreviewPanel = new UIPanel();
				ivjPreviewPanel.setName("PreviewPanel");
				ivjPreviewPanel.setLayout(null);
				ivjPreviewPanel.setBounds(129, 197, 280, 66);
				getDataTypePagePreviewPanel().add(getPreviewLabel(),
						getPreviewLabel().getName());
				ivjPreviewPanel.setBorder(new TitledBorder(new EtchedBorder(),
						MultiLang.getString("uiuforep0000787"), 1, 2, new Font(
								"dialog", 0, 14)));
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjPreviewPanel;
	}

	private JPanel getFontPageSamplePanel() {
		if (ivjSamplePanel == null)
			try {
				ivjSamplePanel = new UIPanel();
				ivjSamplePanel.setName("SamplePanel");
				ivjSamplePanel.setLayout(null);
				ivjSamplePanel.setBounds(5, 159, 400, 103);
				sampleLabel = new LineLabel();
				sampleLabel.setName("SampleLabel");
				sampleLabel.setHorizontalTextPosition(0);
				sampleLabel.setBounds(15, 18, 370, 78);
				sampleLabel.setHorizontalAlignment(0);
				sampleLabel.setOpaque(true);
				showSample();
				getFontPageSamplePanel().add(sampleLabel);
				ivjSamplePanel.setBorder(new TitledBorder(new EtchedBorder(),
						MultiLang.getString("uiuforep0000788"), 1, 2, new Font(
								"dialog", 0, 14)));
			} catch (Throwable ivjExc) {
				System.out.println((new StringBuilder()).append(
						"error in getSamplePanel():").append(
						ivjExc.getMessage()).toString());
				handleException(ivjExc);
			}
		return ivjSamplePanel;
	}

	private JLabel getStringLenLable() {
		if (ivjStringLenLable == null)
			try {
				ivjStringLenLable = new UILabel();
				ivjStringLenLable.setName("StringLenLable");
				ivjStringLenLable.setText(MultiLang
						.getString("uiuforep0000789"));
				ivjStringLenLable.setBounds(23, 21, 70, 22);
				ivjStringLenLable.setVisible(false);
				ivjStringLenLable.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjStringLenLable;
	}

	private JLabel getStringLenText() {
		if (ivjStringLenText == null)
			try {
				ivjStringLenText = new UILabel();
				ivjStringLenText.setName("StringLenText");
				ivjStringLenText.setText("64");
				ivjStringLenText.setBounds(103, 21, 70, 22);
				ivjStringLenText.setVisible(false);
				ivjStringLenText.setForeground(Color.black);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjStringLenText;
	}

	private JPanel getDataTypePageFormatPanel() {
		if (ivjStylePanel == null)
			try {
				ivjStylePanel = new UIPanel();
				ivjStylePanel.setName("StylePanel");
				ivjStylePanel.setLayout(null);
				ivjStylePanel.setBounds(129, 6, 279, 186);
				ivjStylePanel.add(getCommaCheck(), getCommaCheck().getName());
				ivjStylePanel.add(getPercentCheck(), getPercentCheck()
						.getName());
				ivjStylePanel.add(getJLabel4(), getJLabel4().getName());
				ivjStylePanel.add(getDecimalText(), getDecimalText().getName());
				ivjStylePanel.add(getJLabel2(), getJLabel2().getName());
				ivjStylePanel.add(getCurCombo(), getCurCombo().getName());
				ivjStylePanel.add(getJLabel3(), getJLabel3().getName());
				ivjStylePanel.add(getJLabel5(), getJLabel5().getName());
				ivjStylePanel.add(getChineseComb(), getChineseComb().getName());
				ivjStylePanel.add(getDateTypeCombo(), getDateTypeCombo()
						.getName());
				ivjStylePanel.add(getJLabel1(), getJLabel1().getName());
				ivjStylePanel.add(getMinusComb(), getMinusComb().getName());
				ivjStylePanel.add(getStringLenLable(), getStringLenLable()
						.getName());
				ivjStylePanel.add(getStringLenText(), getStringLenText()
						.getName());
				ivjStylePanel.setBorder(new TitledBorder(new EtchedBorder(),
						MultiLang.getString("uiuforep0000790"), 1, 2, new Font(
								"dialog", 0, 14)));
				ivjDecimalText.setEditable(false);
				ivjDecimalText.setBorder(new EtchedBorder());
				Rectangle r = ivjDecimalText.getBounds();
				upAB.setBounds(r.x + r.width, r.y, 18, 14);
				downAB.setBounds(r.x + r.width, r.y + 14, 18, 14);
				getDataTypePageFormatPanel().add(upAB);
				getDataTypePageFormatPanel().add(downAB);
				upAB.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent e) {
						ivjJLabel4.setForeground(Color.black);
						String text = ivjDecimalText.getText();
						int num = Integer.parseInt(text);
						if (num < 7 && num >= 0) {
							text = String.valueOf(++num);
							ivjDecimalText.setText(text);
							setPropertyLater(11, num);
							showPreview();
						}
					}
				});
				downAB.addActionListener(new ActionListener() {

					public void actionPerformed(ActionEvent e) {
						ivjJLabel4.setForeground(Color.black);
						String text = ivjDecimalText.getText();
						int num = Integer.parseInt(text);
						if (num <= 7 && num > 0) {
							text = String.valueOf(--num);
							ivjDecimalText.setText(text);
							setPropertyLater(11, num);
							showPreview();
						}
					}
				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjStylePanel;
	}

	private JList getTypeList() {
		if (ivjTypeList != null)
			return ivjTypeList;
		ivjTypeList = new UIList();
		ivjTypeList.setName("TypeList");
		ivjTypeList.setBounds(10, 23, 103, 146);
		ivjTypeList.setSelectionMode(0);
		ivjTypeList.setBorder(new BevelBorder(1));
		String typeName[] = { MultiLang.getString("uiuforep0000791"),
				MultiLang.getString("uiuforep0000792"),
				MultiLang.getString("uiuforep0000793"),
				MultiLang.getString("uiuforep0001110") };
		ivjTypeList.setListData(typeName);
		int n = getProperty(10);
		if (n == 1 || n == 0 || n == -2) {
			ivjTypeList.setSelectedIndex(0);
			ivjDateTypeComb.setVisible(false);
		} else if (n == 2) {
			ivjTypeList.setSelectedIndex(1);
			ivjTypeList.setBackground(Color.white);
			ivjCommaCheck.setVisible(false);
			ivjPercentCheck.setVisible(false);
			ivjJLabel1.setVisible(false);
			ivjJLabel2.setVisible(false);
			ivjJLabel3.setVisible(false);
			ivjJLabel4.setVisible(false);
			ivjJLabel5.setVisible(false);
			ivjDecimalText.setVisible(false);
			ivjCurCombo.setVisible(false);
			ivjChineseComb.setVisible(false);
			ivjDateTypeComb.setVisible(false);
			ivjMinusComb.setVisible(false);
			upAB.setVisible(false);
			downAB.setVisible(false);
			ivjStringLenLable.setVisible(true);
			ivjStringLenText.setVisible(true);
		} else if (n == 3) {
			ivjTypeList.setSelectedIndex(2);
			ivjTypeList.setBackground(Color.white);
			ivjCommaCheck.setVisible(false);
			ivjPercentCheck.setVisible(false);
			ivjJLabel1.setVisible(false);
			ivjJLabel2.setVisible(false);
			ivjJLabel3.setVisible(false);
			ivjJLabel4.setVisible(false);
			ivjJLabel5.setVisible(false);
			ivjDecimalText.setVisible(false);
			ivjCurCombo.setVisible(false);
			ivjChineseComb.setVisible(false);
			ivjDateTypeComb.setVisible(false);
			ivjMinusComb.setVisible(false);
			ivjStringLenLable.setVisible(false);
			ivjStringLenText.setVisible(false);
			upAB.setVisible(false);
			downAB.setVisible(false);
		} else if (n == 4) {
			ivjTypeList.setSelectedIndex(3);
			ivjTypeList.setBackground(Color.white);
			ivjCommaCheck.setVisible(false);
			ivjPercentCheck.setVisible(false);
			ivjJLabel1.setVisible(false);
			ivjJLabel2.setVisible(false);
			ivjJLabel3.setVisible(false);
			ivjJLabel4.setVisible(false);
			ivjJLabel5.setVisible(true);
			ivjDecimalText.setVisible(false);
			ivjCurCombo.setVisible(false);
			ivjChineseComb.setVisible(false);
			ivjDateTypeComb.setVisible(true);
			ivjMinusComb.setVisible(false);
			ivjStringLenLable.setVisible(false);
			ivjStringLenText.setVisible(false);
			upAB.setVisible(false);
			downAB.setVisible(false);
		} else if (n == -3) {
			ivjTypeList.setBackground(Color.lightGray);
			ivjCommaCheck.setVisible(false);
			ivjPercentCheck.setVisible(false);
			ivjJLabel1.setVisible(false);
			ivjJLabel2.setVisible(false);
			ivjJLabel3.setVisible(false);
			ivjJLabel4.setVisible(false);
			ivjJLabel5.setVisible(false);
			ivjDecimalText.setVisible(false);
			ivjCurCombo.setVisible(false);
			ivjChineseComb.setVisible(false);
			ivjDateTypeComb.setVisible(false);
			ivjMinusComb.setVisible(false);
			ivjStringLenLable.setVisible(false);
			ivjStringLenText.setVisible(false);
			upAB.setVisible(false);
			downAB.setVisible(false);
		}
		if (m_bTypeLocked) {
			ivjTypeList.setEnabled(false);
			return ivjTypeList;
		}
		try {
			ivjTypeList.addListSelectionListener(new ListSelectionListener() {

				public void valueChanged(ListSelectionEvent e) {
					if (!e.getValueIsAdjusting()) {
						int nIndex = ivjTypeList.getSelectedIndex();
						if (nIndex == 0) {
							ivjTypeList.setBackground(Color.white);
							ivjCommaCheck.setVisible(true);
							ivjPercentCheck.setVisible(true);
							ivjJLabel1.setVisible(true);
							ivjJLabel2.setVisible(true);
							ivjJLabel3.setVisible(true);
							ivjJLabel4.setVisible(true);
							ivjJLabel5.setVisible(false);
							ivjDecimalText.setVisible(true);
							ivjCurCombo.setVisible(true);
							ivjChineseComb.setVisible(true);
							ivjDateTypeComb.setVisible(false);
							ivjMinusComb.setVisible(true);
							upAB.setVisible(true);
							downAB.setVisible(true);
							ivjStringLenLable.setVisible(false);
							ivjStringLenText.setVisible(false);
							setPropertyLater(10, 1);
						} else if (nIndex == 1) {
							ivjTypeList.setBackground(Color.white);
							ivjCommaCheck.setVisible(false);
							ivjPercentCheck.setVisible(false);
							ivjJLabel1.setVisible(false);
							ivjJLabel2.setVisible(false);
							ivjJLabel3.setVisible(false);
							ivjJLabel4.setVisible(false);
							ivjJLabel5.setVisible(false);
							ivjDecimalText.setVisible(false);
							ivjCurCombo.setVisible(false);
							ivjChineseComb.setVisible(false);
							ivjDateTypeComb.setVisible(false);
							ivjMinusComb.setVisible(false);
							upAB.setVisible(false);
							downAB.setVisible(false);
							ivjStringLenLable.setVisible(true);
							ivjStringLenText.setVisible(true);
							setPropertyLater(10, 2);
						} else if (nIndex == 2) {
							boolean m_isVara = false;
							if (!m_isVara) {
								ivjTypeList.setBackground(Color.white);
								ivjCommaCheck.setVisible(false);
								ivjPercentCheck.setVisible(false);
								ivjJLabel1.setVisible(false);
								ivjJLabel2.setVisible(false);
								ivjJLabel3.setVisible(false);
								ivjJLabel4.setVisible(false);
								ivjJLabel5.setVisible(false);
								ivjDecimalText.setVisible(false);
								ivjCurCombo.setVisible(false);
								ivjChineseComb.setVisible(false);
								ivjDateTypeComb.setVisible(false);
								ivjMinusComb.setVisible(false);
								ivjStringLenLable.setVisible(false);
								ivjStringLenText.setVisible(false);
								upAB.setVisible(false);
								downAB.setVisible(false);
								setPropertyLater(10, 3);
							} else {
								JOptionPane.showMessageDialog(
										AnaCellFormatSetPnl.this, MultiLang
												.getString("uiuforep0000798"),
										MultiLang.getString("uiuforep0000799"),
										1);
								ivjTypeList.setBackground(Color.white);
								ivjCommaCheck.setVisible(false);
								ivjPercentCheck.setVisible(false);
								ivjJLabel1.setVisible(false);
								ivjJLabel2.setVisible(false);
								ivjJLabel3.setVisible(false);
								ivjJLabel4.setVisible(false);
								ivjJLabel5.setVisible(false);
								ivjDecimalText.setVisible(false);
								ivjCurCombo.setVisible(false);
								ivjChineseComb.setVisible(false);
								ivjDateTypeComb.setVisible(false);
								ivjMinusComb.setVisible(false);
								ivjStringLenLable.setVisible(false);
								ivjStringLenText.setVisible(false);
								upAB.setVisible(false);
								downAB.setVisible(false);
							}
						} else if (nIndex == 3) {
							ivjTypeList.setBackground(Color.white);
							ivjCommaCheck.setVisible(false);
							ivjPercentCheck.setVisible(false);
							ivjJLabel1.setVisible(false);
							ivjJLabel2.setVisible(false);
							ivjJLabel3.setVisible(false);
							ivjJLabel4.setVisible(false);
							ivjJLabel5.setVisible(true);
							ivjDecimalText.setVisible(false);
							ivjCurCombo.setVisible(false);
							ivjChineseComb.setVisible(false);
							ivjDateTypeComb.setVisible(true);
							ivjMinusComb.setVisible(false);
							upAB.setVisible(false);
							downAB.setVisible(false);
							ivjStringLenLable.setVisible(false);
							ivjStringLenText.setVisible(false);
							setPropertyLater(10, 4);
						} else if (nIndex == -1) {
							ivjTypeList.setBackground(Color.white);
							ivjCommaCheck.setVisible(false);
							ivjPercentCheck.setVisible(false);
							ivjJLabel1.setVisible(false);
							ivjJLabel2.setVisible(false);
							ivjJLabel3.setVisible(false);
							ivjJLabel4.setVisible(false);
							ivjJLabel5.setVisible(false);
							ivjDecimalText.setVisible(false);
							ivjCurCombo.setVisible(false);
							ivjChineseComb.setVisible(false);
							ivjDateTypeComb.setVisible(false);
							ivjMinusComb.setVisible(false);
							ivjStringLenLable.setVisible(false);
							ivjStringLenText.setVisible(false);
							upAB.setVisible(false);
							downAB.setVisible(false);
						}
					}
					repaint();
				}
			});
		} catch (Throwable ivjExc) {
			handleException(ivjExc);
		}
		return ivjTypeList;
	}

	private JPanel getDataTypePage() {
		if (ivjTypePagePanel == null)
			try {
				ivjTypePagePanel = new UIPanel();
				ivjTypePagePanel.setName("TypePagePanel");
				ivjTypePagePanel.setLayout(null);
				ivjTypePagePanel.add(getDataTypePageFormatPanel(),
						getDataTypePageFormatPanel().getName());
				ivjTypePagePanel.add(getDataTypePagePreviewPanel(),
						getDataTypePagePreviewPanel().getName());
				ivjTypePagePanel.add(getDataTypePageDataTypePanel(),
						getDataTypePageDataTypePanel().getName());
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjTypePagePanel;
	}

	private JPanel getDataTypePageDataTypePanel() {
		if (ivjTypePanel == null)
			try {
				ivjTypePanel = new UIPanel();
				ivjTypePanel.setName("TypePanel");
				ivjTypePanel.setLayout(null);
				ivjTypePanel.setBounds(3, 6, 123, 186);
				getDataTypePageDataTypePanel().add(getTypeList(),
						getTypeList().getName());
				ivjTypePanel.setBorder(new TitledBorder(new EtchedBorder(),
						MultiLang.getString("uiuforep0000800"), 1, 2, new Font(
								"dialog", 0, 14)));
				showPreview();
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjTypePanel;
	}

	private JPanel getUfoDialogContentPane() {
		if (ivjUfoDialogContentPane == null)
			try {
				ivjUfoDialogContentPane = new UIPanel();
				ivjUfoDialogContentPane.setName("UfoDialogContentPane");
				ivjUfoDialogContentPane.setLayout(null);
				getUfoDialogContentPane().add(getTabbedPane(),
						getTabbedPane().getName());
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjUfoDialogContentPane;
	}

	private JRadioButton getVAutoRadio() {
		if (ivjVAutoRadio == null)
			try {
				ivjVAutoRadio = new UIRadioButton();
				ivjVAutoRadio.setName("VAutoRadio");
				ivjVAutoRadio.setText(MultiLang.getString("uiuforep0000801"));
				ivjVAutoRadio.setBounds(118, 61, 53, 26);
				ivjVAutoRadio.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjVAutoRadio;
	}

	private JRadioButton getVCenterRadio() {
		if (ivjVCenterRadio == null)
			try {
				ivjVCenterRadio = new UIRadioButton();
				ivjVCenterRadio.setName("VCenterRadio");
				ivjVCenterRadio.setText(MultiLang.getString("uiuforep0000802"));
				ivjVCenterRadio.setBounds(260, 61, 53, 26);
				ivjVCenterRadio.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjVCenterRadio;
	}

	private JRadioButton getVDownRadio() {
		if (ivjVDownRadio == null)
			try {
				ivjVDownRadio = new UIRadioButton();
				ivjVDownRadio.setName("VDownRadio");
				ivjVDownRadio.setText(MultiLang.getString("uiuforep0000803"));
				ivjVDownRadio.setBounds(331, 61, 53, 26);
				ivjVDownRadio.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjVDownRadio;
	}

	private JRadioButton getVTopRadio() {
		if (ivjVTopRadio == null)
			try {
				ivjVTopRadio = new UIRadioButton();
				ivjVTopRadio.setName("VTopRadio");
				ivjVTopRadio.setText(MultiLang.getString("uiuforep0000804"));
				ivjVTopRadio.setBounds(189, 61, 53, 26);
				ivjVTopRadio.addActionListener(this);
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjVTopRadio;
	}

	private void handleException(Throwable exception) {
		System.out.println(MultiLang.getString("uiuforep0000805"));
		exception.printStackTrace(System.out);
	}

	private void initialize() {
		try {
			setName("CellPropertyDialog");
			setSize(450, 400);
			setLayout(new BorderLayout());
			add(getUfoDialogContentPane(), BorderLayout.CENTER);
		} catch (Throwable ivjExc) {
			handleException(ivjExc);
		}
		initBorderPageBorderPane();
		setModified(false);
	}

	public boolean isModified() {
		return m_bModified;
	}

	public void mouseClicked(MouseEvent e) {
		int x = e.getX();
		int y = e.getY();
		int values[] = new int[2];
		if (ivjJLineList.getSelectedIndex() != -1)
			values[0] = ivjJLineList.getSelectedIndex();
		else
			values[0] = -2;
		int notDefine[] = { -2, -2 };
		values[1] = ivjLineColorButton.getUserColor().getRGB();
		if (x > m_nXLeft && x < m_nXRight && y > m_nYTop - 10
				&& y < m_nYTop + 10) {
			int curBorder[] = m_borderPanel.getBorderValue(0);
			if (curBorder[0] == -2 || curBorder[1] == -2) {
				m_borderPanel.setBorderValue(0, values);
				m_isNeedResetBorder = true;
				m_updatedBorder[0] = true;
			} else {
				m_borderPanel.setBorderValue(0, notDefine);
				m_isNeedResetBorder = true;
				m_updatedBorder[0] = true;
			}
		}
		if (x > m_nXLeft && x < m_nXRight && y > m_nYBottom - 10
				&& y < m_nYBottom + 10) {
			int curBorder[] = m_borderPanel.getBorderValue(1);
			if (curBorder[0] == -2 || curBorder[1] == -2) {
				m_borderPanel.setBorderValue(1, values);
				m_isNeedResetBorder = true;
				m_updatedBorder[1] = true;
			} else {
				m_borderPanel.setBorderValue(1, notDefine);
				m_isNeedResetBorder = true;
				m_updatedBorder[1] = true;
			}
		}
		if (x > m_nXLeft - 10 && x < m_nXLeft + 10 && y > m_nYTop
				&& y < m_nYBottom) {
			int curBorder[] = m_borderPanel.getBorderValue(2);
			if (curBorder[0] == -2 || curBorder[1] == -2) {
				m_borderPanel.setBorderValue(2, values);
				m_isNeedResetBorder = true;
				m_updatedBorder[2] = true;
			} else {
				m_borderPanel.setBorderValue(2, notDefine);
				m_isNeedResetBorder = true;
				m_updatedBorder[2] = true;
			}
		}
		if (x > m_nXRight - 10 && x < m_nXRight + 10 && y > m_nYTop
				&& y < m_nYBottom) {
			int curBorder[] = m_borderPanel.getBorderValue(3);
			if (curBorder[0] == -2 || curBorder[1] == -2) {
				m_borderPanel.setBorderValue(3, values);
				m_isNeedResetBorder = true;
				m_updatedBorder[3] = true;
			} else {
				m_borderPanel.setBorderValue(3, notDefine);
				m_isNeedResetBorder = true;
				m_updatedBorder[3] = true;
			}
		}
		if (x > m_nXLeft + 10 && x < m_nXRight - 10 && y > m_nYMid - 10
				&& y < m_nYMid + 10) {
			int curBorder[] = m_borderPanel.getBorderValue(4);
			if (curBorder[0] == -2 || curBorder[1] == -2) {
				m_borderPanel.setBorderValue(4, values);
				m_isNeedResetBorder = true;
				m_updatedBorder[4] = true;
			} else {
				m_borderPanel.setBorderValue(4, notDefine);
				m_isNeedResetBorder = true;
				m_updatedBorder[4] = true;
			}
		}
		if (x > m_nXMid - 10 && x < m_nXMid + 10 && y > m_nYTop + 10
				&& y < m_nYBottom - 10) {
			int curBorder[] = m_borderPanel.getBorderValue(5);
			if (curBorder[0] == -2 || curBorder[1] == -2) {
				m_borderPanel.setBorderValue(5, values);
				m_isNeedResetBorder = true;
				m_updatedBorder[5] = true;
			} else {
				m_borderPanel.setBorderValue(5, notDefine);
				m_isNeedResetBorder = true;
				m_updatedBorder[5] = true;
			}
		}
		m_borderPanel.repaint();
	}

	public void mouseEntered(MouseEvent mouseevent) {
	}

	public void mouseExited(MouseEvent mouseevent) {
	}

	public void mousePressed(MouseEvent mouseevent) {
	}

	public void mouseReleased(MouseEvent mouseevent) {
	}

	private void initBorderPageBorderPane() {
		if (m_borderPanel != null) {
			for (int i = 0; i < 8; i++) {
				int values[] = getLineProperty(i);
				m_borderPanel.setBorderValue(i, values);
			}

		}
	}

	public void setModified(boolean newModified) {
		m_bModified = newModified;
	}

	private void setPropertyLater(int nType, int nValue) {
		if (m_propertyCache.containsKey(new Integer(nType)))
			m_propertyCache.remove(new Integer(nType));
		m_propertyCache.put(new Integer(nType), new Integer(nValue));
	}

	/**
	 * @return the m_format
	 */
	public IufoFormat getFormat() {
		return m_format;
	}

	public void saveFormat() {
		IufoFormat format = getFormat();
		Enumeration enums = getPropertyCache().keys();
		do {
			if (!enums.hasMoreElements())
				break;
			Integer tmpType = (Integer) enums.nextElement();
			int nType = tmpType.intValue();
			int nValue = ((Integer) getPropertyCache().get(tmpType)).intValue();
			setCellProperty(format, nType, nValue);
		} while (true);
	}

	protected void setCellProperty(IufoFormat format, int nType, int nValue) {
		PropertyType.setPropertyByType(format, nType, nValue);
	}

	public void showPreview() {
		String disTextStr = null;
		Object value = null;
		IufoFormat format = new IufoFormat();
		format.setDateType(getDateTypeCombo().getSelectedIndex());
		Integer objDataType = (Integer) m_propertyCache.get(new Integer(10));
		if (objDataType != null && objDataType.intValue() == 4) {
			Date srcDate = value != null && (value instanceof Date) ? (Date) value
					: null;
			disTextStr = format.getDateStr(srcDate);
		} else {
			format.setChineseFormat(getChineseComb().getSelectedIndex());
			if (getCommaCheck().isSelected())
				format.setHasComma(1);
			else
				format.setHasComma(0);
			format.setDecimalDigits(Integer
					.parseInt(getDecimalText().getText()));
			if (getPercentCheck().isSelected())
				format.setHasPercent(1);
			else
				format.setHasPercent(0);
			format.setCurrencySymbol(getCurCombo().getSelectedIndex());
			int nIndex = getMinusComb().getSelectedIndex();
			format.setMinusFormat(nIndex);
			double dValue = -1234567.1234567D;
			if (format.isMinusRed()) {
				getMinusComb().setForeground(Color.red);
				getPreviewLabel().setForeground(Color.red);
			} else {
				getMinusComb().setForeground(
						UIManager.getColor("ComboBox.foreground"));
				getPreviewLabel().setForeground(
						UIManager.getColor("Lable.foreground"));
			}
			disTextStr = format.getString(dValue);
		}
		getPreviewLabel().setText(disTextStr);
	}

	public void showSample() {
		if (sampleLabel == null)
			return;
		m_strFontName = DefaultSetting.fontNames[ivjFontNameComb
				.getSelectedIndex()];
		m_nFontStyle = ivjFontTypeComb.getSelectedIndex();
		switch (m_nFontStyle) {
		case 1: // '\001'
			m_nFontStyle = 1;
			break;

		case 2: // '\002'
			m_nFontStyle = 2;
			break;

		case 3: // '\003'
			m_nFontStyle = 3;
			break;

		default:
			m_nFontStyle = 0;
			break;
		}
		m_nFontSize = Integer.parseInt((String) ivjFontSizeComb
				.getSelectedItem());
		m_nForColor = ivjForeColorButton.getUserColor();
		m_nBackColor = ivjBackColorButton.getUserColor();
		FillCellIcon icon = new FillCellIcon(false, 6, 400, 78);
		sampleLabel.setIcon(icon);
		sampleLabel.setBackground(m_nBackColor);
	}

	public Hashtable getPropertyCache() {
		return m_propertyCache;
	}

	public void setPropertyCache(Hashtable oldProperty) {
		if (oldProperty == null) {
			return;
		} else {
			m_propertyCache = oldProperty;
			return;
		}
	}

	public Object getPropertyExtended() {
		return null;
	}

	private int getProperty(int nType) {
		return PropertyType.getPropertyByType(m_format, nType);
	}

	private int[] getLineProperty(int direction) {
		int vValue[] = { -2, -2 };
		switch (direction) {
		case 0: // '\0'
			vValue[0] = getProperty(28);
			vValue[1] = getProperty(27);
			break;

		case 1: // '\001'
			vValue[0] = getProperty(4);
			vValue[1] = getProperty(3);
			break;

		case 2: // '\002'
			vValue[0] = getProperty(26);
			vValue[1] = getProperty(25);
			break;

		case 3: // '\003'
			vValue[0] = getProperty(22);
			vValue[1] = getProperty(21);
			break;

		case 4: // '\004'
			vValue[0] = getProperty(31);
			vValue[1] = getProperty(30);
			break;

		case 5: // '\005'
			vValue[0] = getProperty(33);
			vValue[1] = getProperty(32);
			break;

		case 6: // '\006'
			vValue[0] = getProperty(42);
			vValue[1] = getProperty(41);
			break;

		case 7: // '\007'
			vValue[0] = getProperty(44);
			vValue[1] = getProperty(43);
			break;

		default:
			throw new IllegalArgumentException(MultiLang
					.getString("uiuforep0000776"));
		}
		return vValue;
	}

	private JButton getBtnDiagonal() {
		if (btnDiagonal == null) {
			btnDiagonal = new UIButton();
			btnDiagonal.setBounds(new Rectangle(11, 224, 74, 19));
			btnDiagonal.addActionListener(this);
			btnDiagonal.setText(MultiLang.getString("miufo00005"));
		}
		return btnDiagonal;
	}

	private JButton getBtnDiagonal2() {
		if (btnDiagonal2 == null) {
			btnDiagonal2 = new UIButton();
			btnDiagonal2.setBounds(new Rectangle(87, 224, 74, 19));
			btnDiagonal2.addActionListener(this);
			btnDiagonal2.setText(MultiLang.getString("miufo00006"));
		}
		return btnDiagonal2;
	}

	private JCheckBox getAlignPageShrinkFitCheck() {
		if (ivjShrinkFitCheck == null)
			try {
				ivjShrinkFitCheck = new UICheckBox();
				ivjShrinkFitCheck.setName("ShrinkFitCheck");
				ivjShrinkFitCheck.setText(MultiLang
						.getString("uiuforep0001112"));
				ivjShrinkFitCheck.setBounds(18, 147, 178, 27);
				int n = getProperty(35);
				if (n == -2 || n == 0)
					ivjShrinkFitCheck.setSelected(false);
				else if (n == 1) {
					ivjShrinkFitCheck.setSelected(true);
					getAlignPageChangeLineCheck().setEnabled(false);
				} else if (n == -3) {
					ivjShrinkFitCheck.setSelected(true);
					ivjShrinkFitCheck.setForeground(Color.gray);
				}
				ivjShrinkFitCheck.addItemListener(new ItemListener() {

					public void itemStateChanged(ItemEvent e) {
						if (e.getStateChange() == 1) {
							setPropertyLater(35, 1);
							ivjChangeLineCheck.setEnabled(false);
						} else if (e.getStateChange() == 2) {
							setPropertyLater(35, 0);
							ivjChangeLineCheck.setEnabled(true);
						}
						ivjShrinkFitCheck.setForeground(Color.black);
					}
				});
			} catch (Throwable ivjExc) {
				handleException(ivjExc);
			}
		return ivjShrinkFitCheck;
	}

	private static final long serialVersionUID = -9170930342589119315L;
	private JPanel ivjUfoDialogContentPane;
	private JLabel ivjJLabel1;
	private JLabel ivjJLabel2;
	private JLabel ivjJLabel3;
	private JLabel ivjJLabel4;
	private JLabel ivjJLabel5;
	private JButton ivjcancelButton;
	private UITabbedPane ivjCellTabbedPane;
	private JLabel ivjJLabelBackground;
	private JLabel ivjJLabel6;
	private JLabel ivjJLabel7;
	private JLabel ivjJLabel8;
	private JLabel ivjJLabel9;
	private JLabel ivjJLabel12;
	private JLabel ivjJLabel13;
	private JLabel ivjJLabel14;
	private JLabel ivjJLabel15;
	private JLabel ivjJLabel16;
	private JLabel ivjJLabel17;
	private JPanel ivjAligPanel;
	private ColorButton ivjBackColorButton;
	private JPanel ivjBorderPagePanel;
	private JCheckBox ivjChangeLineCheck;
	private JCheckBox ivjShrinkFitCheck;
	private JComboBox ivjChineseComb;
	private JPanel ivjColorPanel;
	private JCheckBox ivjCommaCheck;
	private JComboBox ivjCurCombo;
	private JTextField ivjDecimalText;
	private JComboBox ivjFontNameComb;
	private JPanel ivjFontPagePanel;
	private JPanel ivjFontPanel;
	private JComboBox ivjFontSizeComb;
	private JComboBox ivjFontTypeComb;
	private ColorButton ivjForeColorButton;
	private JRadioButton ivjHAutoRadio;
	private JRadioButton ivjHCenterRadio;
	private JRadioButton ivjHLeftRadio;
	private JRadioButton ivjHRightRadio;
	private JButton ivjInnerLineButton;
	private ColorButton ivjLineColorButton;
	private JPanel ivjLineStylePanel;
	private JComboBox ivjMinusComb;
	private JButton ivjNoLineButton;
	private JButton ivjOuterLineButton;
	private JCheckBox ivjPercentCheck;
	private JLabel ivjPreviewLabel;
	private JPanel ivjPreviewPanel;
	private JPanel ivjSamplePanel;
	private JPanel ivjStylePanel;
	private JList ivjTypeList;
	private JPanel ivjTypePagePanel;
	private JPanel ivjTypePanel;
	private JRadioButton ivjVAutoRadio;
	private JRadioButton ivjVCenterRadio;
	private JRadioButton ivjVDownRadio;
	private JRadioButton ivjVTopRadio;
	private JLabel ivjStringLenLable;
	private JLabel ivjStringLenText;
	private JComboBox ivjDateTypeComb;
	private Hashtable m_propertyCache;
	private JButton ivjOkButton;
	private LineLabel sampleLabel;
	private JPanel ivjAligPagePanel;
	private JPanel ivjBorderPanel;
	private JList ivjJLineList;
	BasicArrowButton upAB;
	BasicArrowButton downAB;
	BorderPanel m_borderPanel;
	private int m_nXLeft;
	private int m_nXRight;
	private int m_nYTop;
	private int m_nYBottom;
	private int m_nXMid;
	private int m_nYMid;
	private boolean m_LineisNull;
	private boolean m_isNeedResetBorder;
	private boolean m_updatedBorder[];
	private String m_strFontName;
	private int m_nFontStyle;
	private int m_nFontSize;
	private Color m_nForColor;
	private Color m_nBackColor;
	private boolean m_bModified;
	private IufoFormat m_format;
	private boolean m_bTypeLocked;
	private boolean m_bSingleSelected;
	private boolean m_bCondition;
	private JButton btnDiagonal;
	private JButton btnDiagonal2;

}
